virtual wallet design of bcd binary converters
DESCRIPTION
Virtual Wallet Design of BCD Binary Converters. Gates Winkler Jordan Samuel Fei Yin Shen October 19 , 2009. To create a handheld device which will save money and time through budget assistance and improve the shopping experience. Status. Finished Flow Chart Behavioral Verilog - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/1.jpg)
Virtual WalletDesign of BCD Binary Converters
To create a handheld device which will save money and time through budget assistance and improve the shopping experience.
• Gates Winkler • Jordan Samuel Fei• Yin Shen
• October 19 , 2009
![Page 2: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/2.jpg)
StatusFinished• Flow Chart• Behavioral Verilog• Transistor Estimate • Floor Plan• Structure Proposal• Structural Verilog• Schematic
To Do • Layout• Testing
![Page 3: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/3.jpg)
Introduction
• Binary – Representing numbers on a “2” scale. – Ex. 19 = 10011
• BCD – Representing numbers on a “10” scale
using a “2” scale. – Each set of 4 bits stores 1 base 10 digit.
• Called a nibble.
– Ex. 19 = 0001 1001 (2 nibbles)• 0001 = 1; 1001 = 9
![Page 4: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/4.jpg)
When Converting
• It is important to remember that though both are represented with 0 and 1s they will have different lengths when converted.
• BCD bit length will always be a multiple of 4
Number Number of Bits
Binary BCD
0-1 1 4
16-20 5 8
100 7 12
10000 14 20
10e6 20 28
![Page 5: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/5.jpg)
Binary To BCD Algorithm
• Assumes the necessary number of bits to store the nibbles are all initialized to 0.
• Ex. Binary 51 = 110011
• Needs 2 nibbles all set to 0 => 0000 0000
![Page 6: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/6.jpg)
Step 1 – Check For >=5
• Check all nibbles to see if any are >= 5.– 0000 < 5– 0000 < 5
• If none are >= do nothing.
![Page 7: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/7.jpg)
Step 2 – Shift Left
• Shift all bits left shifting the MSB of the binary number into the LSB of the BCD number. Anything can be shifted in.
• Initial: 0000 0000 : 110011
• After Shift: 0000 0001: 10011X
![Page 8: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/8.jpg)
Step 3 – Repeat
• Repeat x times where x = length of binary number.
• 1 Run: 0000 0001: 10011X
• 2 Run: 0000 0011: 0011XX
• 3 Run: 0000 0110: 011XXX
• Wait… After 3 runs there is a nibble that that is >= 5.
![Page 9: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/9.jpg)
Step 1b – Greater or Equal 5
• If any nibbles are >= 5 then add 3 (0011) to that nibble. No nibble can ever be >9 so overflow is impossible.
• 0000 < 5• 0110 >5 thus
– 0110 + 0011 = 1001
• After adding continue with step 2– Initial: 0000 0110: 011XXX– After Increasing Nibbles: 0000 1001: 011XXX– After Shift: 0001 0010: 11XXXX
![Page 10: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/10.jpg)
Step 3 – Repeat (Again)
• Finish repeating.• 4 Run: 0001 0010: 11XXXX• 5 Run: 0010 0101: 1XXXXX• 6 Run After Adding: 0010 1000: 1XXXXX
– 6 After Shifting: 0101 0001: XXXXXX
• Final answer: 51• 0101 = 5• 0001 = 1
![Page 11: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/11.jpg)
BCD To Binary Algorithm
• Practically identical but reversed. Here are the changes. • Step 1 Shift
– Shifts right instead of left– LSB of BCD is shifted into MSB of Binary– Must Shift in 0s
• Step 2 Greater than/equal to 8– Compares each BCD nibble to 8 instead.
• If less than do nothing.• If greater than/equal subtract 3 from the nibble.
• Step 3 Repeat (again)• Repeat x times where x = length of binary number.
![Page 12: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/12.jpg)
Structural
• Binary To BCD– Needs 48 Flip Flops– 7 4-bit adders (28 1-bit adders)– 7 compare blocks.
• BCD To Binary– Needs 48 Flip Flops– 7 4-bit subtracters (28 1-bit subtracters)– 7 compare blocks.
![Page 13: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/13.jpg)
Flip Flops – Output
• The Output Flip Flops can be regular Sequential Flip Flops.
Q
QSET
CLR
D
Q
QSET
CLR
D
Q
QSET
CLR
D
Q
QSET
CLR
D
clock
input…Q9 Q8 Q1 Q0
![Page 14: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/14.jpg)
Flip Flops – Input
• The Input Flip Flops will be parallel Flip-Flops which allows us to chose whether we want to shift or write.
• The nand gates allow for the flip flops to be written to on low write while it acts as a shifter on high write.
![Page 15: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/15.jpg)
Compare to 5
Assumes 4 bit input B[3:0]. Use a Truth table to figure out block configuration
![Page 16: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/16.jpg)
Binary – BCD 1 Nibble
![Page 17: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/17.jpg)
Compare to 8
• Easy, if Cin = 1 then the nibble will become 8 or greater.
• Don’t need a compare.
![Page 18: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/18.jpg)
BCD – Binary 1 Nibble
![Page 19: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/19.jpg)
Note
• In a BCD – Binary converter the BCD is the input. Thus the Flip Flops are actually the ones shown on slide 13.
• Binary Just Shifts without anything fancy. Just Needs respective Flip Flops.
![Page 20: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/20.jpg)
Schematics Binary - BCD
![Page 21: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/21.jpg)
BCD - Binary
![Page 22: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/22.jpg)
Binary – BCD: Binary
![Page 23: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/23.jpg)
Parallel Flip Flop
![Page 24: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/24.jpg)
Flip Flop
![Page 25: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/25.jpg)
Nand Block
![Page 26: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/26.jpg)
Binary – BCD: BCD
![Page 27: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/27.jpg)
Binary – BCD: 1 nibble
![Page 28: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/28.jpg)
Compare to 5
![Page 29: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/29.jpg)
BCD – Binary: Binary
![Page 30: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/30.jpg)
BCD – Binary: BCD
![Page 31: Virtual Wallet Design of BCD Binary Converters](https://reader036.vdocuments.us/reader036/viewer/2022081507/56815a7a550346895dc7e44a/html5/thumbnails/31.jpg)
BCD – Binary: BCD 1 nibble