1. Examples
1. (123)8 = ( ? )Gray Code
Solution: (123)8 = (_______)GrayCode
1. Convert octal to binary (123)8 = (_______)2
`:.` (123)8 = (1010011)2
2. Convert binary to GrayCode Binary code : `1010011`
Method-1: (Binary to Gray code) `g_6=b_6=1`
`g_5=b_6 o+ b_5=1 o+ 0=1`
`g_4=b_5 o+ b_4=0 o+ 1=1`
`g_3=b_4 o+ b_3=1 o+ 0=1`
`g_2=b_3 o+ b_2=0 o+ 0=0`
`g_1=b_2 o+ b_1=0 o+ 1=1`
`g_0=b_1 o+ b_0=1 o+ 1=0`
`:.` Gray code : `1111010`
Method-2: (Binary to Gray code)`b_6` `1` | `b_5` `0` | `b_4` `1` | `b_3` `0` | `b_2` `0` | `b_1` `1` | `b_0` `1` | Binary code | `b_6` `1` | `b_6 o+ b_5` `1 o+ 0` | `b_5 o+ b_4` `0 o+ 1` | `b_4 o+ b_3` `1 o+ 0` | `b_3 o+ b_2` `0 o+ 0` | `b_2 o+ b_1` `0 o+ 1` | `b_1 o+ b_0` `1 o+ 1` | | `darr` | `darr` | `darr` | `darr` | `darr` | `darr` | `darr` | | `1` `g_6` | `1` `g_5` | `1` `g_4` | `1` `g_3` | `0` `g_2` | `1` `g_1` | `0` `g_0` | Gray code |
`:.` Gray code : `1111010`
`:.` (123)8 = (1111010)GrayCode
2. (345)8 = ( ? )Gray Code
Solution: (345)8 = (_______)GrayCode
1. Convert octal to binary (345)8 = (_______)2
`:.` (345)8 = (11100101)2
2. Convert binary to GrayCode Binary code : `11100101`
Method-1: (Binary to Gray code) `g_7=b_7=1`
`g_6=b_7 o+ b_6=1 o+ 1=0`
`g_5=b_6 o+ b_5=1 o+ 1=0`
`g_4=b_5 o+ b_4=1 o+ 0=1`
`g_3=b_4 o+ b_3=0 o+ 0=0`
`g_2=b_3 o+ b_2=0 o+ 1=1`
`g_1=b_2 o+ b_1=1 o+ 0=1`
`g_0=b_1 o+ b_0=0 o+ 1=1`
`:.` Gray code : `10010111`
Method-2: (Binary to Gray code)`b_7` `1` | `b_6` `1` | `b_5` `1` | `b_4` `0` | `b_3` `0` | `b_2` `1` | `b_1` `0` | `b_0` `1` | Binary code | `b_7` `1` | `b_7 o+ b_6` `1 o+ 1` | `b_6 o+ b_5` `1 o+ 1` | `b_5 o+ b_4` `1 o+ 0` | `b_4 o+ b_3` `0 o+ 0` | `b_3 o+ b_2` `0 o+ 1` | `b_2 o+ b_1` `1 o+ 0` | `b_1 o+ b_0` `0 o+ 1` | | `darr` | `darr` | `darr` | `darr` | `darr` | `darr` | `darr` | `darr` | | `1` `g_7` | `0` `g_6` | `0` `g_5` | `1` `g_4` | `0` `g_3` | `1` `g_2` | `1` `g_1` | `1` `g_0` | Gray code |
`:.` Gray code : `10010111`
`:.` (345)8 = (10010111)GrayCode
This material is intended as a summary. Use your textbook for detail explanation. Any bug, improvement, feedback then
|