Computer Architecture Lab 3
Computer Architecture Lab 3
LAB # 3
Introduction to Behavioural Modelling
through implementation of Arithmetic Logic Unit (ALU) and its
simulation using Xilinx ISE tools and implementation on FPGA
board.
NOTE: Use the name of new source same as that of verilog modules present in
notepad files.
Procedure:
1. Launch the Xilinx ISE 7.1 software as follows:
Start >> Programs >> Xilinx ISE 7.1 >> Project Navigator
6. Click Next.
7. In the next window of ‘Select Device and Design Flow for the Project’:
Select the simulator as : ISE simulator
In the Device Family option,
Select Spartan3
In the Device option
Select xc3s200
In the Package option
Select ft256
In the Speed Grade option
Select -5
In the Top Level Module Type option
Select HDL
In the Synthesis Tool option
Select XST(VHDL/Verilog)
In the Simulator option
Select ISE Simulator
In the Generated Simulation Language option
Select Verilog
always @ (a or b or sel)
case (sel)
0: out = a + b;
1: out = a - b;
2: out = b + 1;
3: out = a - 1;
4: out = ~a;
5: out = a & b;
6: out = a | b;
7: out = ~a + 1;
endcase
endmodule
Codes of following are available & Present in a notepad file. Just copy from
there and paste.
Points to Ponder:
• Synthesis the ALU.
• See the test bench waveform.
• Implement on FPGA board. (Spartan 3)
ASSIGNMENT (To do in today lab session):
a) To implement an ALU, having two 4 bit inputs with also a 4 bit selection line. The
output should be also 4bit with a single bit carry flag and zero flag.
sel out
4’b0000 Sum the inputs
4’b0001 Subtract b from a
4’b0010 Increment b by 1
4’b0011 Decrement a by 1
4’b0100 Not a
4’b0101 Bitwise and of a & b
4’b0110 Bitwise or of a & b
4’b0111 Two’ complement of a
4’b1000 Barrel Shifter***
4’b1001 Comparator*
4’b1010 Equality**
4’b1011 Multiplication of inputs
4’b1100 Bitwise Nand of two inputs
4’b1101 Tale one’s Complement of ‘b’
4’b1110 Subtract ‘a’ from ‘b’
4’b1111 Bitwise Exclusive OR
// Write Code
endmodule