roy.coy
Newbie level 1

i am trying to design a 4-bit Arithmetic Logic Unit (ALU) and implement it using the Xilinx Spartan 3 FPGA on the Digilent Spartan 3 development board.
The ALU needs to provide two different functions: subtract (A-B) and multiply (A*B). There will be two 4-bit operands A<3:0> and B<3:0> which both express signed (positive and negative) integer numbers. 2’s complement representation is used to represent signed values. The two operands A and B will be set by the sliding switches on the Digilent FPGA board (SW7-SW0).
There will be 4, 1-bit function buttons: BTN3-BTN0 on the Digilent board. These will be used to select between the two ALU functions. ‘ON state’ means that a button is pressed down.
There will be four 7-segment displays used to display input operands and the results in hexadecimal format. Two 7-segment displays on the left in the display block should always display the input operands A<3:0> and B<3:0>. The other two displays on the right should display the result according to the function buttons, as follows:
Function buttons Result
BTN3 BTN2 BTN1 BTN0
OFF OFF OFF ON A – B
OFF OFF ON OFF A * B
All other combinations 0
For all arithmetic operations the result should be the correct two’s complement value in hexadecimal format.
please help me doing this task.. i am badly stuked and i need to complete this in couple of days....
i have already designed following parts:-
Full Adder
7-segment display
Half Adder
The ALU needs to provide two different functions: subtract (A-B) and multiply (A*B). There will be two 4-bit operands A<3:0> and B<3:0> which both express signed (positive and negative) integer numbers. 2’s complement representation is used to represent signed values. The two operands A and B will be set by the sliding switches on the Digilent FPGA board (SW7-SW0).
There will be 4, 1-bit function buttons: BTN3-BTN0 on the Digilent board. These will be used to select between the two ALU functions. ‘ON state’ means that a button is pressed down.
There will be four 7-segment displays used to display input operands and the results in hexadecimal format. Two 7-segment displays on the left in the display block should always display the input operands A<3:0> and B<3:0>. The other two displays on the right should display the result according to the function buttons, as follows:
Function buttons Result
BTN3 BTN2 BTN1 BTN0
OFF OFF OFF ON A – B
OFF OFF ON OFF A * B
All other combinations 0
For all arithmetic operations the result should be the correct two’s complement value in hexadecimal format.
please help me doing this task.. i am badly stuked and i need to complete this in couple of days....
i have already designed following parts:-
Full Adder
7-segment display
Half Adder