Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

>>>VHDL help XILINX

Status
Not open for further replies.

musicgal

New Member
hey folks, i'm kind of new to this forum..

well i had a major problem in creating a vhdl program that decodes bcd to 7 segments

yes they do have tutorials on it but it onli applies to ONE BCD

i need 3 BCDs and 3 seven segments as i have 3 digits
eg: 1 1 7 revolution per min


so how do i program it in such a way that the value of each digit will be displayed in seven segment?

here is how my program should work...


i already made a bcd counter that counts from 1 to 99

so for example it stops at 12.

counta := 2 --least significant bit
countb := 1 -- most significant bit.


so i use a adder and i combine them together as twelve

sum <= countb&counta;

so it will be the digit 12 = 0001 0010



i had to do a multiplyer by six.. but that is another problemm

but i know that my value will be in 3 BCD

for example

1 0 1 rpm

so yup yup i do hope someone can help me out in this.. its been a real headache and i hope you all understand what i'm trying to say

i'm willing to show peeps the program i partially did .. thanks a bunch
urgent...


yours sincerely,
musicgal
 
Last edited:
Hi
It is better to use only one BCD to seven segment VHDL program and try to design a multiplexer as digit selector to manege the data of each digit in this method you need less pins and writing a multiplexer VHDL program is easyer
Kamal Daniel
 
I think you need to take a deep breath, think about what you are trying to say, and then rewrite your question in a clear and concise manner.

One can only guess how data is being handled in your design and from what I gathered in your post, I have a feeling it isn't in an efficient manner.

Driving multiple 7-seg displays from an FPGA is a rather trivial exercise and you can find several examples on the web just by looking at VHDL tutorials. Post your code and give a better description of what you are doing and I'm sure someone can help you out.
 
Why are you converting a binary number to BCD and then multiplying it? It would be far easier to multiply first and then convert to BCD.

Instead of multiplying by 6, can you change your system to multiply by a power of 2? If you can, you can save a lot of hardware resources by left shifting your answer.

What FPGA will you be implementing the design in? Does it have hardware multipliers built in? If you have to multiply by 6, it may be adventageous to use the built in hardware.
 
...sorry to all...

so sorry to trouble all of you who has read this...

okok i try to explain clearer,

for example i am doing a heart rate counter.

for your information, i'm using cpld .

using xilinx, i have to create a program which counts a number of pulses within a certain time eg : 12 heartbeats within 10 secs, afterwhich i have to multiply them by 6 to get it in beats per min, which is 60 beats per min.

as explained earlier, if i have 12 heartbeats within 10 secs,

counta := 1 -- most significant beat
countb := 2 -- least significant beat


actually just to inform you all, it doesnt have to be exactly 10, it could be 6 secs, or other different timing as we are using 555 timer,


i didnt intend to combine them together, but i have no clue how to multiply
them when they are seperated.



whereas for bcd to 7 segment display... maybe i will just seperate them as you all adviced, and just add more case count for each digit... *i suppose*


i hope my explanation is quite detailed enough and i realli wish you all can help me...


my main problem is actually multiplying to get the final answer. :(
 
musicgal said:
oo another question.. .can i do multiplication on PIC program???

As Nigel said, you can do most anything you want with a PIC but if you figure out how to build a multiplier in VHDL it will be significantly faster.

If you want to keep things very easy, 18F devices have built in multipliers.
 
Originally Posted by tkbits
You can eliminate the multiply by 6 if you count by 6 instead of 1.
musicgal said:
sorry , do not quite understand, can please elaborate? thanks a bunch

Instead of adding 1 to the counter
Code:
count x6 display
0     0  0
1     6  6
2     12 12
3     18 18

just add 6 to the counter directly:
Code:
count display
0     0
6     6
12    12
18    18

You can also build a ROM that has a multiplication table containing only the "times 6" values.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top