Professional Documents
Culture Documents
EXPERIMENT 11
1- Aim: To write Verilog code for ALU(74381) using the behavioral model.
2- Theory :
ALUs comprise the combinational logic that implements logic operations such
as AND, OR, NOT gate, and arithmetic operations, such as Adder, and
Subtractor.
- Logic symbols :
- Connection diagram :
- Functional description :
Signals applied to the Select inputs S0–S2 determine the mode of operation, as
indicated in the Function Select Table. An extensive listing of input and output
levels is shown in the Truth Table. The circuit performs the arithmetic functions
for either active HIGH or active LOW operands, with output levels in the same
convention. In the Subtract operating modes, it is necessary to force a carry
(HIGH for active HIGH operands, LOW for active LOW operands) into the Cn
input of the least significant package. The Carry Generate (G) and Carry
Propagate (P) outputs supply input signals to the 74182 carry-lookahead
generators for expansion to longer word length, as shown in Figure 2. Note
that a 74381 ALU is used for the most significant package. Typical delays for
Figure 2 are given in Figure 1.
3- Verilog code :
module alu_74381(out,A,B,S,cin);
input [2:0] S;
input cin;
output[3:0] out;
begin
case (S)
3'b000 : out = 4'b0000;
3'b100 : out = A ^ B;
3'b101 : out = A | B;
endcase
end
endmodule
- Schematic :
RTL schematic :
Synthesized schematic :
- Utilization report :
- Delay summary :
SETUP :
HOLD :