Question: Question 1 Write Verilog design code for a module named add sub 4 bit , which has the below interface: Inputs: x and y -
Question
Write Verilog design code for a module named
add
sub
bit
which has the below interface:
Inputs:
x
and
y
bits: s compliment numbers
add
sub
select
bit
Outputs:
z
bits: s compliment result
carry
out
bit
The testbench for this design has been provided. In this design, when the
add
sub
select
signal
is set to
the output
z
should be the sum of the input signals
xy
When
add
sub
select
is
set to
z
should be set to
x
y
Implement this design using both structural using only logic gates like ANDs, ORs, inverters, and
XORs and behavioral logic. Not that in this module you dont need to worry about overflows.
Create separate projects for each implementation of your design. The same testbench
can be used for both projects
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
