Homework Assignment for Digital Logic Design, Assignments of Digital Systems Design

Instructions and problems for a digital logic design homework assignment. The assignment includes drawing schematics, writing verilog descriptions, and designing various digital circuits such as decoders, arithmetic blocks, and counters. The circuits must meet specifications and be tested using simulation results.

Typology: Assignments

Pre 2010

Uploaded on 08/13/2009

koofers-user-wu4
koofers-user-wu4 🇺🇸

10 documents

1 / 4

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Homework 2
Please complete Problem 1, 2, 3, and 4 and turn these problems in at the beginning of
class on Monday, Sept 22.
The solutions to all questions will be posted after class on Monday so that you will have
the solutions to study for the exam. I suggest you try to work Problem 5 and 6 BEFORE
looking at the solutions.
For problems 2, 3, 5, and 6, please perform each of the following steps:
(a) Draw a symbol of the device showing all inputs and outputs.
(b) Develop a synthesizable verilog description.
(c) Develop a testbench to test the operation of the device
(d) Verify that your circuit meets specifications.
Please turn in all verilog code and a hardcopy of your simulation results. You can
demonstrate proper operation by either a printout of the “monitor” output (the table
printed once the simulation has been run) or by a printout of the waveforms (The results
of some problems are easier to see one way and the results of other problems are easier to
see another). Be sure to annotate your simulation results telling me how your results
prove that you have met all specifications.
Problem 1:
Provide a schematic of the circuit that the following Verilog description should produce.
Once you have produced the schematic, answer the following questions.
a) Could any lines of code be removed without changing the functionality?
Explain your answer
b) Under what conditions of A and B is the output 00002?
/*
* Module comb:
* performs combinational logic...
* what DOES it do?
*/
module comb( A, B, O );
// inputs
input [3:0] A, B;
// outputs
output [3:0] O;
// identifiers
wire cl, cg, ce;
reg [1:0] e;
reg [3:0] O;
/* Functionality */
assign cl = (A < B);
assign ce = (A == B);
pf3
pf4

Partial preview of the text

Download Homework Assignment for Digital Logic Design and more Assignments Digital Systems Design in PDF only on Docsity!

Homework 2

Please complete Problem 1, 2, 3, and 4 and turn these problems in at the beginning of

class on Monday, Sept 22.

The solutions to all questions will be posted after class on Monday so that you will have

the solutions to study for the exam. I suggest you try to work Problem 5 and 6 BEFORE

looking at the solutions.

For problems 2, 3, 5, and 6 , please perform each of the following steps:

(a) Draw a symbol of the device showing all inputs and outputs.

(b) Develop a synthesizable verilog description.

(c) Develop a testbench to test the operation of the device

(d) Verify that your circuit meets specifications.

Please turn in all verilog code and a hardcopy of your simulation results. You can

demonstrate proper operation by either a printout of the “monitor” output (the table

printed once the simulation has been run) or by a printout of the waveforms (The results

of some problems are easier to see one way and the results of other problems are easier to

see another). Be sure to annotate your simulation results telling me how your results

prove that you have met all specifications.

Problem 1:

Provide a schematic of the circuit that the following Verilog description should produce.

Once you have produced the schematic, answer the following questions.

a) Could any lines of code be removed without changing the functionality?

Explain your answer

b) Under what conditions of A and B is the output 0000 2?

  • Module comb:
  • performs combinational logic...
  • what DOES it do? */ module comb( A, B, O );

// inputs input [3:0] A, B;

// outputs output [3:0] O;

// identifiers wire cl, cg, ce; reg [1:0] e; reg [3:0] O;

/* Functionality */ assign cl = (A < B); assign ce = (A == B);

assign cg = (A > B);

always @(cg or ce or cl) case( {1'b0,cg,ce,cl} ) 4'b0001: e <= 2'b00; 4'b0010: e <= 2'b01; 4'b0100: e <= 2'b10; 4'b1000: e <= 2'b11; default: e <= 2'b00; endcase

always @(e or A or B) if( e == 2'b00 ) O <= B; else if( e == 2'b01 ) O <= ~A; else if( e == 2'b10 ) O <= A; else O <= 4'b0000;

endmodule

Problem 2:

Design a 5-to-32 binary decoder. Outputs are active high. Thus, only one output is high,

determined by the binary input, and all others are low. The decoder also has an active low

enable. If the enable is low, all outputs are low. If the enable is high, the decoder operates

as described.

Problem 3:

Design a 4-bit arithmetic block that performs the following functions. You may only use

muxes, NOR gates, and 4 full adders. Assume all inputs are 4-bit binary numbers in 2’s

complement form. (Hint: This problem should sound very familiar! Be sure to think

about the hardware before implementing this design to ensure an efficient design.)

S1 S0 Function

0 0 A+B

0 1 A-B

1 0 A+

1 1 A-

Before writing your verilog descriptions, draw a schematic of the circuit. Be sure to think

about the hardware before implementing this design to ensure an efficient design.

S1 S0 Function

0 0 Shift right

0 1 Shift left

1 0 Hold

1 1 Parallel load