diff options
author | Michael Abed <michaelabed@gmail.com> | 2012-02-16 15:46:55 -0500 |
---|---|---|
committer | Michael Abed <michaelabed@gmail.com> | 2012-02-16 15:46:55 -0500 |
commit | 0bdf2f0b18f7e2986336f8afc67fe18b8b382e7a (patch) | |
tree | 0546ba14ba410a565b6bff722a23b26860744825 /ALU.v | |
download | ec311-lab2-0bdf2f0b18f7e2986336f8afc67fe18b8b382e7a.tar.gz ec311-lab2-0bdf2f0b18f7e2986336f8afc67fe18b8b382e7a.tar.bz2 ec311-lab2-0bdf2f0b18f7e2986336f8afc67fe18b8b382e7a.zip |
initial commit
Diffstat (limited to 'ALU.v')
-rwxr-xr-x | ALU.v | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -0,0 +1,38 @@ +`timescale 1ns / 1ps
+//////////////////////////////////////////////////////////////////////////////////
+// Company:
+// Engineer:
+//
+// Create Date: 15:30:47 02/15/2012
+// Design Name:
+// Module Name: ALU
+// Project Name:
+// Target Devices:
+// Tool versions:
+// Description:
+//
+// Dependencies:
+//
+// Revision:
+// Revision 0.01 - File Created
+// Additional Comments:
+//
+//////////////////////////////////////////////////////////////////////////////////
+module ALU(
+ input [1:0] s, + input [3:0] a,
+ output [3:0] o
+ );
+ +reg [3:0] o;
+
+always @ ( * )
+begin
+ case ( s )
+ 2'd0 : o = a;
+ 2'd1 : o = ~a+1;
+ 2'd2 : o = a >> 1;
+ 2'd3 : o = a % 3;
+ endcase
+end
+endmodule
|