Nothing Special   »   [go: up one dir, main page]

Lab 1 & 2

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

FPGA BASED SYSTEM DESIGN LAB

LAB 1 & 2 TASK

LAB 1:
1. Write Verilog HDL code for Half Adder using Gate Level, Data Flow and Behavioural
Modeling.
Synthesize and implement using Xilinx tools and also attach RTL schematic of each modeling
repectively.

SOLUTION:
CODE:
module adder( a,b,sum,cout);

input a;

input b;

output sum;

output cout;

xor(sum,a,b);

and(cout,a,b);

endmodule

DATA FLOW:

module adder( a,b,sum,cout);

input a;

input b;

output sum;

output cout;

assign sum = a^b;

assign cout = a&b;

endmodule;
BEHAVIOURAL:

module adder( a,b,sum,cout);

input a;

input b;

output sum;

output cout;

reg sum;

reg cout;

always@(a or b)

begin

sum = a^b;

cout = a&b;

end

endmodule

IMPLEMENTATION:
LAB 2:
Write a Verilog code for blinking LEDs on FPGA board. Upload the program on board by
following the above procedure. Attach snapshots of each step.
SOLUTION/IMPLEMENTATION:

You might also like