Sample f Nlsol
Sample f Nlsol
03
1
Question 1. [30 points, 10 such questions]
1. [3 points] In the standard carry-lookahead we make use of two sig-
nals g and p. What is their proper name?
g for generate
p for propagate
7. [3 points]
8. [3 points]
9. [3 points]
10. [3 points]
2
Question 2.
[20 points]
1. [7 points]
2. [7 points] Write the truth table for the following logic function
F = A + BC + B′C′
ABC F
000 1
001 0
010 0
011 1
100 1
101 1
110 1
111 1
3
Question 3.
[50 points]
1. [20 points] Assume you are given a module called incr that im-
plements a combinational circuit that has a four bit input and a four
bit output. The output is the input plus one. Write a simple Verilog
module that has an one bit input C, another one bit input pulse and
a four bit output Z. The output is normally zero when the input C is
zero, but when the input C becomes one, then at the next sixteen puls-
es (pulse) the circuit counts from zero to fifteen and back to zero
(i.e. 0, 1, 2, ..., 14, 15, 0, 1...)
module cntr(C, pulse, Z);
input C, pulse;
output reg [3:0] Z;
incr myincr(Zin,Z);
always @(posedge C)
Z <= 4’b0000;
endmodule // cntr
4
2. [7 points] Write three versions of a module that implements a half
adder using
(1) the always construct of Verilog
(2) the assign construct
(3) the primitive gates AND, OR, NOT.
module hadd1(S, Cout, a, b);
output S, Cout;
input a, b;
assign S = aˆb;
assign Cout = a&b;
endmodule // hadd1
always @(a,b)
begin
S = aˆb;
Cout = a&b;
end
endmodule // hadd1