design a circuit, and model using HDL, that 1) adds two three bit unsigned binar
ID: 1832739 • Letter: D
Question
design a circuit, and model using HDL, that 1) adds two three bit unsigned binarynumbers, 2) includes a flag to determine when a overflow occurs, and 3) includes a flag
indicating whether the resulting sum is even or odd.
You should create a test bench and test your design by completing the sums below.
000 + 000
010 + 001
011 + 011
111 + 001
Your inputs and outputs should be defined as follows:
A2, A1, A0 : B2, B1, B0 Represent your binary inputs, 0 defines least significant bit
Sum Represents the output sum
O Represents the overflow flag, no overflow = 0
P Represents the even/odd flag, even = 0
what would this HDL file look like?
Explanation / Answer
module adder (sum,o,p,a,b) ; input [2:0] a,b; output [2:0] reg sum; output reg p,v; always @(a,b) begin {o,sum}Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.