External 7 segment connnected with Zybo

Recommended Posts


This is the second project for me in FPGA for fun.

I want to connect external board with 7 seg as a counter, so I put this Verilog code with this XDC file but the output is something error , could you please figure it out?

I use common Anode display


pin 1 ---> pin 12 (7 Seg)

pin 2 ----> Pin 9

pin 3 ---> Pin 8

pin 4 -----> pin 6



pin 1 ---> pin 11

pin 2----> pin 7

pin 3-----> pin 4

pin 4 ----> pin 2

pin 5 ----> pin 1

pin 6 ---> pin 10

pin 7 ----> pin 5

pin 8 ----> pin 3





Edited by Hayder
Link to post
Share on other sites

Hi @Hayder,

The errors help us determine what is wrong. Could you please copy and past the vivado errors into a text file and add to the thread. Also looking at the xdc you need to uncomment the second line of for the clock(line 17 in xdc). In your verilog code you declare 2 input buttons "input [1:0]btn" but in the xdc you only constrain btn[0]. So if you are using 2 buttons then you would need to uncommnent the second button on line 41 of the xdc. 



Link to post
Share on other sites

Hi @jpeyron

There are no errors in Vivado, the 7 segment display rubbish char...

After searching I found that my 7 segment is common cathode not common Anode, so please how can change the programming according to ?

just reverse lines 53,59,65

ja_p = 4'b0111;  ------> ja_p = 4'1000; ?

also reverse LED_BCD bits?

Thanks again

Edited by Hayder
Link to post
Share on other sites

Hi @Hayder,

Here is a verilog code for a common cathode from fpga4fun that has three different example codes that should help you if there is an issue with the assignment of LED_BCD. The code you are using works off of the 100 Mhz clock of the basys 3. The zybo has a 125 Mhz clock when used as you are in the PL. The reference manual in section 12 details this. The change in frequency can also effect how the 7 segment display looks visually. You might want to use the clock wizard to change the clock to 100 Mhz. 



Edited by jpeyron
Link to post
Share on other sites

Hello @jpeyron

I wrote simple Verilog for displaying just one number

module one(
    output  [1:0] ja_p,
    output [6:0] jb_p
    assign ja_p = 2'b0;
    assign jb_p = 7'b1111100;


But I got strange char as in the attached picture !!

I connected my Display as:

A- 11

B- 7

C- 4

D- 2

E- 1

F- 10

G- 5

And when I remove one wire , the corresponding segment went off so I think the wiring is OK...

Thanks again for help



Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now