-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathALU_1_Bit.v
36 lines (29 loc) · 1.21 KB
/
ALU_1_Bit.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
`timescale 1ns / 1ps
//*******************************************************************************
// Michael Tangy //
// ECE 483-001 //
// //
// 6/22/2015 //
// //
// This file contains the structural Description of the 1 bit ALU using logic //
// gates adders and multiplexers //
//*******************************************************************************
module ALU_1_Bit(
input A,
input B,
input Cin,
input [3:0] select,
output Co,
output O
);
wire Aout, Bout, Anot, Bnot, AndOut, OrOut, Sum;
not n1(Anot, A);
not n2(Bnot, B);
two_one_mux M1(Aout,A,Anot,select[3]);
two_one_mux M2(Bout,B,Bnot,select[2]);
and G1(AndOut, Aout, Bout);
or G2(OrOut, Aout, Bout);
FullAdder FA(Sum,Co,Aout,Bout,Cin);
not n3(NandOut, AndOut);
four_one_mux M3(O, AndOut, OrOut, Sum, B, select[1:0]);
endmodule