Digital Electronics Page: Difference between revisions
Jump to navigation
Jump to search
Line 1: | Line 1: | ||
=Gray | =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. | 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. | ||
<table> | <table> | ||
<tr><td>Decimal (base 10)</td><td>Binary (base 2)</td><td>Binary-Reflected (no base)</td></tr> | <tr><td>Decimal (base 10)</td><td>BCD Binary (base 2)</td><td>Gray Binary-Reflected (no base)</td></tr> | ||
<tr><td>0</td><td>0000</td><td>0000</td></tr> | <tr><td>0</td><td>0000</td><td>0000</td></tr> | ||
<tr><td>1</td><td>0001</td><td>0001</td></tr> | <tr><td>1</td><td>0001</td><td>0001</td></tr> | ||
Line 15: | Line 15: | ||
<tr><td>9</td><td>1001</td><td>1101</td></tr> | <tr><td>9</td><td>1001</td><td>1101</td></tr> | ||
<tr><td>10</td><td>1010</td><td>1111</td></tr> | <tr><td>10</td><td>1010</td><td>1111</td></tr> | ||
</table> | |||
=Excess-3 Codes= | |||
<table> | |||
<tr><td>Decimal (base 10)</td><td>BCD Binary (base 2)</td><td></td></tr> | |||
<tr><td>0</td><td>0000</td><td>0011<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>3</td><td>0011</td><td>0110<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>6</td><td>0110</td><td>1001<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>9</td><td>1001</td><td>1100<td></td> | |||
</table> | </table> |
Revision as of 22:49, 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.
Decimal (base 10) | BCD Binary (base 2) | Gray Binary-Reflected (no base) |
0 | 0000 | 0000 |
1 | 0001 | 0001 |
2 | 0010 | 0011 |
3 | 0011 | 0010 |
4 | 0100 | 0110 |
5 | 0101 | 0111 |
6 | 0110 | 0101 |
7 | 0111 | 0100 |
8 | 1000 | 1100 |
9 | 1001 | 1101 |
10 | 1010 | 1111 |
Excess-3 Codes
Decimal (base 10) | BCD Binary (base 2) | ||
0 | 0000 | 0011 | |
1 | 0001 | 0100 | |
2 | 0010 | 0101 | |
3 | 0011 | 0110 | |
4 | 0100 | 0111 | |
5 | 0101 | 1000 | |
6 | 0110 | 1001 | |
7 | 0111 | 1010 | |
8 | 1000 | 1011 | |
9 | 1001 | 1100 |