May 3, 2013 #1 X xilinx1001 Member level 3 Joined Apr 3, 2013 Messages 60 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,781 Hi, I need to develop a VHDL code for 9 bit binary to BCD number. I searched in internet and find code for converting 8 bit and 10 bit numbers Can anyone help me in writing the code for this 9 bit binary number Last edited: May 3, 2013
Hi, I need to develop a VHDL code for 9 bit binary to BCD number. I searched in internet and find code for converting 8 bit and 10 bit numbers Can anyone help me in writing the code for this 9 bit binary number
May 3, 2013 #2 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,392 Helped 14,748 Reputation 29,778 Reaction score 14,091 Trophy points 1,393 Location Bochum, Germany Activity points 297,965 I searched in internet and find code for converting 8 bit and 10 bit numbers Click to expand... So you got the answer, isn't it? I presume you know how to delete lines of code.
I searched in internet and find code for converting 8 bit and 10 bit numbers Click to expand... So you got the answer, isn't it? I presume you know how to delete lines of code.
May 3, 2013 #3 X xilinx1001 Member level 3 Joined Apr 3, 2013 Messages 60 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,286 Activity points 1,781 Hi, Thanks for your reply Can I use this 10 bit binary number conversion here for 9 bit I think for 10 bit binary conversion, it will shift 10 times Can I use that here
Hi, Thanks for your reply Can I use this 10 bit binary number conversion here for 9 bit I think for 10 bit binary conversion, it will shift 10 times Can I use that here
May 3, 2013 #4 FvM Super Moderator Staff member Joined Jan 22, 2008 Messages 52,392 Helped 14,748 Reputation 29,778 Reaction score 14,091 Trophy points 1,393 Location Bochum, Germany Activity points 297,965 It will do more than just shift. See https://en.wikipedia.org/wiki/Double_dabble But basically, you'll save one shift when reducing from 10 to 9 bit. And you get only 3 output nibbles.
It will do more than just shift. See https://en.wikipedia.org/wiki/Double_dabble But basically, you'll save one shift when reducing from 10 to 9 bit. And you get only 3 output nibbles.
May 5, 2013 #5 O OhaAmo Member level 4 Joined Mar 4, 2012 Messages 75 Helped 7 Reputation 14 Reaction score 7 Trophy points 1,288 Activity points 1,685 You can use a case state on the binary number, generally looks like: case (bin_num) 0000 : seven_seg = 1111 0001 : seven_seg = 0101 ... 1111: ... where seven_seg is a variable holding 0/1 for each bit of 7 seg outputs.
You can use a case state on the binary number, generally looks like: case (bin_num) 0000 : seven_seg = 1111 0001 : seven_seg = 0101 ... 1111: ... where seven_seg is a variable holding 0/1 for each bit of 7 seg outputs.