Verilog Palnitkar Solutions Chapter 9
Verilog Palnitkar Solutions Chapter 9
fa0 d_sum=1,d_cout-1
fa1 d_sum=2,d_cout=2
fa2 d_sum=2,d_cout=2
fa3 d_sum=3,d_cout=3
7. Consider the 4-bit full adder in example 6-4. Write a stimulus file to do
random testing of the full adder. Use a random number generator to
generate a 32-bit random number. Pick bit 3:0 and apply them to input a;
pick bits 7:4 and apply them to input b. Use bit 8 and apply it to c_in. Apply
20 random test vectors and observe the output
My answer:
8. Use the 8-bit memory initialization example in example 9-14 . Modify the
file to read data in hexadecimal. Write a new data file with the following
addresses and data values. Unspecified locations are not initialized.
Location Address Data
1 33
2 66
4 z0
5 0z
6 01
My answer:
9. Write an initial block that controls the VCD file. The initial block must do
the following:
l Set myfile.dmp as the output VCD file.
l Dump all variables two levels deep in module instance top.a1.b1.c1.
l Stop dumping to VCD at time 200.
l Start dumping to VCD at time 400.
l Stop dumping to VCD at time 500.
l Create a checkpoint. Dump the current value of all VCD variables to the
dumpfile.
My answer: