Digital Electronics Page: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
No edit summary
Line 37: Line 37:
<table>
<table>
<tr><td>Decimal</td><td>BCD</td><td>Excess-3</td></tr>
<tr><td>Decimal</td><td>BCD</td><td>Excess-3</td></tr>
<tr><td>0</td><td>0000</td><td>0011<td></td>
<tr><td>0</td><td>0000</td><td>0011</td></td>
<tr><td>1</td><td>0001</td><td>0100<td></td>
<tr><td>1</td><td>0001</td><td>0100</td></td>
<tr><td>2</td><td>0010</td><td>0101<td></td>
<tr><td>2</td><td>0010</td><td>0101</td></td>
<tr><td>3</td><td>0011</td><td>0110<td></td>
<tr><td>3</td><td>0011</td><td>0110</td></td>
<tr><td>4</td><td>0100</td><td>0111<td></td>
<tr><td>4</td><td>0100</td><td>0111</td></td>
<tr><td>5</td><td>0101</td><td>1000<td></td>
<tr><td>5</td><td>0101</td><td>1000</td></td>
<tr><td>6</td><td>0110</td><td>1001<td></td>
<tr><td>6</td><td>0110</td><td>1001</td></td>
<tr><td>7</td><td>0111</td><td>1010<td></td>
<tr><td>7</td><td>0111</td><td>1010</td></td>
<tr><td>8</td><td>1000</td><td>1011<td></td>
<tr><td>8</td><td>1000</td><td>1011</td></td>
<tr><td>9</td><td>1001</td><td>1100<td></td>
<tr><td>9</td><td>1001</td><td>1100</td></td>
</table>
</table>

Revision as of 23:09, 14 January 2023


Gray Codes

This is a technique where we convert number from binary to grays. We do this because Gray reduces the bits we need to change to get to the next number. e.g. changing from 2 to 3 decimal requires a 1 bit change.

DecimalBCDGray Code
000000000
100010001
200100011
300110010
401000110
501010111
601100101
701110100
810001100
910011101
1010101111

Excess-3 Codes

To get an excess-3 code of a decimal number simply add 3 to each decimal digit. And then we write the 4-bit binary number for each digit of the decimal number. We can find the excess-3 code of the given binary number by using the following steps:

  • We find the decimal number of the given binary number.
  • Then we add 3 in each digit of the decimal number.
  • Now, we find the binary code of each digit of the newly generated decimal number.

We can also add 0011 in each 4-bit BCD code of the decimal number for getting excess-3 code.

DecimalBCDExcess-3
000000011
100010100
200100101
300110110
401000111
501011000
601101001
701111010
810001011
910011100