Docsity

Assignment #5 - Digital Logic Design I Combinational Logic | CDA 3100, Assignments of Electrical and Electronics Engineering

Toggle sidebar
bg1
Assignment #5 – Digital Logic Design I – Combinational Logic
CDA 3100, Computer Organization I, Spring 2009
¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾
Problem 1 (50 points) Design a circuit that takes three bits X2, X1, X0, as input, and output one
bit O as output. O is 1 if and only if 1<=X<=3 when X=(X2, X1, X0) is read as an unsigned
integer.
(a) Construct the truth table.
(b) Write down the sum-of-product form of the function without any simplification in the
form as: O = (X2 & X1 & X0) | (~X2 & X1 & X0) | … (this is NOT the answer).
(c) Simplify the circuit using K-map.
(d) Write down the Verilog module for this circuit called module HW5P1 (X2, X1, X0, O).
(e) Simulate the designed module with the provided Verilog test bench. Copy and paste the
waveform to the submitted homework (one way to copy and paste is (1) print screen (2)
paste the screen to the windows paint program (3) crop the waveform.).
Problem 2 (50 points) Design a circuit that takes three bits A, B, S as input, and output one bit
O as output. If S=0, O=A&B. If S=1, O=A|B.
(a) Construct the truth table.
(b) Write down the sum-of-product form of the function without any simplification in the
form as: O = (A &B&S) |(A &B&~S) | … (this is NOT the answer)
(c) Simplify the circuit using K-map.
(d) Write down the Verilog module for this circuit called module HW5P2 (S,A,B,O).
(e) Simulate the designed module with the provided Verilog test bench. Copy and paste the
waveform to the submitted homework (one way to copy and paste is (1) print screen (2)
paste the screen to the windows paint program (3) crop the waveform.).
pf3

Partial preview of the text

Download Assignment #5 - Digital Logic Design I Combinational Logic | CDA 3100 and more Assignments Electrical and Electronics Engineering in PDF only on Docsity!

Assignment #5 – Digital Logic Design I – Combinational Logic

CDA 3100, Computer Organization I, Spring 2009 ¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾¾ Problem 1 (50 points) Design a circuit that takes three bits X2, X1, X0, as input, and output one bit O as output. O is 1 if and only if 1<=X<=3 when X=(X2, X1, X0) is read as an unsigned integer. (a) Construct the truth table. (b) Write down the sum-of-product form of the function without any simplification in the form as: O = (X2 & X1 & X0) | (~X2 & X1 & X0) | … (this is NOT the answer). (c) Simplify the circuit using K-map. (d) Write down the Verilog module for this circuit called module HW5P1 (X2, X1, X0, O). (e) Simulate the designed module with the provided Verilog test bench. Copy and paste the waveform to the submitted homework (one way to copy and paste is (1) print screen (2) paste the screen to the windows paint program (3) crop the waveform.). Problem 2 (50 points) Design a circuit that takes three bits A, B, S as input, and output one bit O as output. If S=0, O=A&B. If S=1, O=A|B. (a) Construct the truth table. (b) Write down the sum-of-product form of the function without any simplification in the form as: O = (A &B&S) |(A &B&~S) | … (this is NOT the answer) (c) Simplify the circuit using K-map. (d) Write down the Verilog module for this circuit called module HW5P2 (S,A,B,O). (e) Simulate the designed module with the provided Verilog test bench. Copy and paste the waveform to the submitted homework (one way to copy and paste is (1) print screen (2) paste the screen to the windows paint program (3) crop the waveform.).

Problem 3 (Extra 10 points) Design a comparator which has 6 input bits, A2, A1, A0 and B2, B1, B0, and one output bit O. Let A=( A2, A1, A0) and B=(B2, B1, B0), and regard them as unsigned integers. If A>B, O=1; else O=0. Hint: This problem should be solved by analyzing the underlying logic and no K-map is needed. For example, if A2=1 and B2=0, O must be 1 and there is no need to check the values of other input bits. Problem 4 (Extra 10 points) We talked about multiplexors in the class. A 4-1 multiplexor has 6 inputs: S1, S0, d3, d2, d1, and d0. It has one output, O. It works as follows. If S1S0=00, O=d0. If S1S0=01, O=d1. If S1S0=10, O=d2. If S1S0=11, O=d3. Show how to use only one 4- multiplexor (no any other gates should be used, including the inverter, meaning that no “bubbled input” is allowed) to implement function F(A,B,C) with truth table as follows. Hint: For this problem, no K-map is needed, and you may connect some of the inputs of the multiplexor to 0’ or1’ if needed. A B C Output 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0 The Verilog code that will be needed in this homework is: http://www.cs.fsu.edu/~zzhang/CDA3100_Spring_2009_files/HW5.v