Hi, im trying to make a 8bits to 3digits 7segments decoder usind a
double dabble, but there is something wrong with my code and i dont know
what, can you help me?
> but there is something wrong with my code and i dont know what
Do you have a test bench for the code?
> but there is something wrong with my code and i dont know what
Really your code?
bcd1<=to_bcd(3downto0);-- 4 bits input for a 8 bit function?
7
bcd2<=to_bcd(7downto4);f
8
bcd3<=to_bcd(11downto7);
This looks for me like more like:
"I have copied some pieces of code from somewhere, do not understand
even one line, and its not working like i expected! Whats wrong?"
So, first try to understand what to_bcd does and how you have to use it.
A hint: you only have to call this function once.
You can do this here much more compact, if you convert only one digit
(the one to be displayed) and multiplex the bcd input instead of the
segment /output/:
i've made this code by using one that i've found on the internet, i used
a double dabble(and i understud it) code with a sweep code for 7segments
that i've(not from internet) made sometime ago that showed the word
'DATE' and 'HORA' for example on a 4digit 7segment display, it showed 1
letter each clock time on a diferent digit, so i use a realy fast clock
and it looks like that it was appearing simultaneously, i just try to
join the 2 codes, i didnt found it anywhere
BUTT i doesnt work, no matter what i try, and i tryed alot, and i dont
know what is wrong with it, thats why im asking on this forum
but thx for the tip, ill try it
One thing i have noticed :
you used copy&paste to decode 4 bits to a 7-segment digit, but you
forgot to change the destination register.
your bcd1 bcd2 and bcd3 all (!) work on only S1. I think bcd1 should be
decocded in S1, bcd2 in S2 and bcd3 in S3, i seems to make more sense,
than using only S1. And anyway, later on you use S2 and S3 without
having made an assignment. perhaps this is the reason why it won't work.