Question: Create an 8 - bit adder using the Verilog addition operator ( + ) . Connect the adder s inputs to two 8

Create an 8-bit adder using the Verilog addition operator ("+"). Connect the adders inputs to two 8-bit registers that can each be individually loaded from 8 slide switches by pressing a corresponding pushbutton (see code below). Connect the adders output to two digits of the seven-segment display. Since the inputs are 8-bit binary numbers, you should use a seven-segment controller than can generate hex digits as well as BCD digits.
reg [7:0] op1, op2; always @ (posedge(clk)) begin if (btn[0]) op1= sw; if (btn[1]) op2= sw; end
Configure the adder to be an adder/subtractor by including a circuit that can change one of the operand inputs into its negated twos-compliment form (i.e., invert all the bits and add one). Use a pushbutton to select between addition and subtraction.
Create an 8 - bit adder using the Verilog

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!