Computer Architecture Lab 5a
Computer Architecture Lab 5a
Computer Architecture Lab 5a
LAB # 5
Strengthening of concepts of behavioural modelling with deep
familiarization with FPGA board.
Continued…
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
And copy all the files present in Lab5 folder present in desktop.
Synthesis the code and see its behavioural simulation on test bench.
1) See the attached file for pin configuration of seven segment display.
2) Assign the pin package in user constraints according to the above
configuration.
3) Assign clk (input) to T9 pin in the package.
After saving the pin package assignment. Just implement the design and generate
programming file and see the output.
Note : You will be graded only if you are able to run the implement the program on
the FPGA Board.
Module Definition:
Controller:
Connectivity:
Code:
//Interface
module Interface(a , b ,clk , c_i, rst, u_d ,disp_ind, disp_sel);
endmodule
//connectivity
module connectivity(sel, a, b, c_i, rst, u_d, clk, out);
input [1:0] sel;
input [3:0] a, b;
input c_i, rst, u_d, clk;
output [6:0] out;
endmodule
// controller
module controller(clk, out_anode, clk_div2, clk_div);
input clk;
output [1:0]clk_div2;
output clk_div;
output [3:0]out_anode;
endmodule
// arbitrary_count_sequence
module arbitrary_count_sequence(clk, out);
input clk;
output reg [3:0] out = 0;
reg [2:0] count = 0;
always @ (count)
case (count)
0 : out = 4'hA;
1 : out = 4'h1;
2 : out = 4'hE;
3 : out = 4'h9;
4 : out = 4'h6;
5 : out = 4'h3;
default : out = 4'hA;
endcase
endmodule
// bcd_adder
module bcd_adder(addend, augend, carry_in, S, output_carry);
wire carry;
reg K;
reg [3:0] Z;
always @ (Z or carry)
S = {1'b0, carry, carry, 1'b0} + Z;
endmodule
// counter
module counter(rst, up_down, clk, out);
input rst, up_down, clk;
output reg [3:0] out = 0;
endmodule
// mux_4to1_4bit
module mux_4to1_4bit(a, b, c, d, sel, out);
input [3:0] a, b, c, d;
input [1:0] sel;
output reg [3:0] out;
always @ (a or b or c or d or sel)
case (sel)
0 : out = a;
1 : out = b;
2 : out = c;
3 : out = d;
default : out = a;
endcase
endmodule
// binary_to_7seg_decoder
module binary_to_7seg_decoder(in, out);
input [3:0] in;
output reg [6:0] out;
always @ (in)
case (in)
4'h0 : out = 7'b0000001;
4'h1 : out = 7'b1001111;
4'h2 : out = 7'b0010010;
4'h3 : out = 7'b0000110;
4'h4 : out = 7'b1001100;
4'h5 : out = 7'b0100100;
4'h6 : out = 7'b0100000;
4'h7 : out = 7'b0001111;
4'h8 : out = 7'b0000000;
4'h9 : out = 7'b0000100;
4'hA : out = 7'b0001000;
4'hB : out = 7'b1100000;
4'hC : out = 7'b0110001;
4'hD : out = 7'b1000010;
4'hE : out = 7'b0110000;
4'hF : out = 7'b0111000;
endcase
endmodule
// crude_clock_div2
module crude_clock_div2(clk, clk_out2);
input clk;
output [1:0] clk_out2;
endmodule
// crude_clock_divider
module crude_clock_divider(clk_in, clk_out);
input clk_in;
output clk_out;
endmodule
// dec_for_anode_cntrl
module dec_for_anode_cntrl(sel ,out);
always @ (sel)
begin
case(sel)
0: out = 4'b1110;
1: out = 4'b1101;
2: out = 4'b1011;
3: out = 4'b0111;
endcase
end
endmodule