There was an error while loading. Please reload this page.
1 parent d8a91cf commit 0cc3ad2Copy full SHA for 0cc3ad2
example/mips/shift_microoperation.v
@@ -0,0 +1,30 @@
1
+module shift_microoperation (
2
+ clock,
3
+ reset,
4
+ a_in,
5
+ lift_serial_input,
6
+ right_serial_input,
7
+ selective_set,
8
+ data
9
+);
10
+ input clock, reset;
11
+ input [3:0] a_in;
12
+ input lift_serial_input;
13
+ input right_serial_input;
14
+ input selective_set;
15
+ output [3:0] data;
16
+
17
+ reg [3:0] data;
18
19
+ always @ (posedge clock) begin
20
+ if (reset) begin
21
+ data = 0;
22
+ end else begin
23
+ case (selective_set)
24
+ 0: data = {right_serial_input, a_in[3:1]};
25
+ 1: data = {a_in[2:0], lift_serial_input};
26
+ endcase
27
+ end
28
29
30
+endmodule
0 commit comments