Anda di halaman 1dari 12

# Objective -:

1) Design a Pulse Waveform with controllable Duty Cycle and time period.
2) Develop circuit and verilog code to display Name on 7 segment display.

Apparatus Required -:
1)
2)
3)
4)
5)
6)
7)
8)

Vivardo IDE.
Bread Board.
Connecting wires.
Zybo Board.
Resistors.
IC ULN2003.
7 Segment Display.
BC177 PNP Transistor

Theory -:
Counter -: In digital logic and computing, a Counter is a device which stores
(and sometimes displays) the number of times a particular
event or process has occurred, often in relationship to a clock signal.
Synchronous Counters: In synchronous counters, the clock inputs of
all the flip-flops are connected together and are triggered by the input
pulses. Thus, all the flip-flops change state simultaneously (in
parallel).
Asynchronous Counters: In an asynchronous counter, the flip flop
output transition serves as a source for triggering other flip flops. In
other words, the clock pulse inputs of all flip flops, except the first,

are triggered not by the incoming pulses, but rather by the transition
that occurs in previous flip flops output.

4 Bit Counter
Image Source www.rheingoldheavy.com
Duty Cycle -: A Duty Cycle is the percentage of one period in which a
signal or system is active. Duty cycle is commonly expressed as a
percentage or a ratio. A period is the time it takes for a signal to complete an
on-and-off cycle.

## Duty cycle = (Ton /T) * 100

Source learn.sparkfun.com

## 7-Segment Display -: A seven-segment display, or seven-segment indicator,

is a form of electronic display device for displaying decimal numerals that is
an alternative to the more complex dot matrix displays. Seven-segment
displays are widely used in digital clocks, electronic meters, basic
calculators, and other electronic devices that display numerical information
or even letters.
Each LED has two connecting pins, namely Anode & Cathode. Thus, there
are therefore two types of LED 7-segment displays: Common Cathode (CC)
and Common Anode (CA).

Source Quora.com

Source www.pantechsolutions.net
ULN2003 IC -: The ULN2003A is an array of seven NPN Darlington
transistors capable of 500mA, 50V output. A Darlington transistor (also
known as Darlington pair) achieves very high current amplification by
connecting two bipolar transistors in direct DC coupling so the current
amplified by the first transistor is amplified further by the second one.

Source www.engineersgarage.com

source www.kitronik.co.uk

Procedure -:
Waveform & Duty Cycle:
Generate a 0.5 Hz clock from the 125 MHz clock inbuilt in the Zybo
board.
Write a Verilog program to generate pulses at predefined duration and duty
cycle.
Compile and simulate the code & check the results via simulation.
Create an XDC file defining the user constraints.
Synthesize, implement and burn it on the Zybo & demonstrate the
waveform on the oscilloscope.
Single 7-Segment Display Output:
Write a Verilog code to display the name, one character at a time on the 7
segment display. Simulate, synthesize, implement and burn code onto the
FPGA after writing XDC file.

## Pulse Waveform Design:

module src(
input clk,
output reg c,d,e
);
reg [31:0]counter;
initial counter = 32'b0;
initial c=1'b1;
initial d=1'b1;
initial e=1'b1;
always @(posedge clk)
begin
counter = counter + 1;
if(counter%250000000==0)
begin
counter=0;
c=1;d=1;e=1;
end
else
begin
if(c==1 & counter % 62500000==0)
c=0;
if(d==1 & counter % 125000000==0)
d=0;
if(e==1 & counter % 187500000==0)
e=0;
end
end
endmodule

## o 7-Segment LED Single Display:

module Src (clk, d);
output reg d;
reg [31:0]counter;
input clk;
initial counter = 32'b0;
initial d=1'b1;
always @(posedge clk)
begin
counter = counter + 1;
if (counter % 125000000==0)
begin
d=1;
counter <= 0;
end
else
begin
if (d==1 & counter % 62500000==0)
d=0;
end
end
endmodule
module display (clk,seg);
output [6:0]seg;
input clk;
wire d;
Src count(clk,d);
reg counter;
initial counter=1'b0;
reg [6:0] seg;
initial seg = 7'b0;
always @(negedge d)

begin
counter = counter + 1;
if (counter == 1)
seg = 7'b0110001;
else if (counter == 2)
seg = 7'b1110111;
else if (counter == 3)
seg = 7'b0011110;
else if (counter == 4 )
seg = 7'b1110111;
else if (counter == 5)
counter = 0;
end
endmodule

Observations:Counter :-

Simulation

Waveform
Yellow 25%
Blue 50 %
Purple 75 %

Simulation

## Conclusion:1.)ULN Driver is used to run the 7 segment display. It ensures the

safety of Zybo Board. In actuality we can just use any IC(a
simple not gate) instead of ULN.
2.) Resistor is used to control the brightness of 7 segment display.
3.)With the help of zybo clock we can form different waveforms
with different duty cycle.
4.)