1.1 KiB
1.1 KiB
Feb 3, 2025 | ECE2700; HW 2 | Boehme, James
1.
Problem Statement:
Describe in Verilog, a full adder that accepts the following three one bit inputs:
x
,y
, and the carry-in bitc
; and it generates the following two one-bit outputs: the sum bitsum
and the carry-out bitcout
.
Part a) For the first full-adder design, describe the
sum
output using structural verilog, and the carry-out outputcout
using behavioral verilog.
Part B) Describe the second full-adder design using hierarchical Verilog. Describe the half-adder module first using behavioral Verilog. Then instantiate two half adders in your full adder.
Part C) Create a Verilog testbench for the complete full-adder circuit. Make sure your testbench provides all input combinations for your full adder module.
Given
The logic expressions
sum = \bar{x}y\bar{c}_i + x\bar{y}\bar{c}_i +\bar{x}\bar{y}\bar{c}_i + xyc_i
cout = xy + xc_i + yc_i