Digital Electronics/Data Encoder

Digital Encoder Introduction
Digital Encoder is a Digital Device that uses binary number of n bit to represent a number of base ten. Binary number of n bit is called Binary Coded Decimal (BCD), a coding scheme used in digital to encode informations

If there are two control lines A and B, we can have 4 4-bit-binary-numbers a3a2a1a0 which can be used to represent a number of base ten from 0 to 3
 * {| class="wikitable" width=50%

! A !! B !! a3 !! a2!! a1!! a0 !! Decimal Number
 * 0 || 0 || 0 || 0 || 0 || 0 || 0
 * 0 || 0 || 0 || 0 || 0 || 0 || 0


 * 0 || 1 || 0 || 0 || 0 || 1 || 1
 * 1 || 0 || 0 || 0 || 1 || 0 || 2
 * 1 || 1 || 0 || 0 || 1 || 1 || 3
 * }
 * 1 || 1 || 0 || 0 || 1 || 1 || 3
 * }
 * }
 * }

BCD - Binary Coded Decimal
In order to encode decimal number from 0 - 9 using Binary Coded Decimal Scheme, 10 4-bit-Binary-numbers are used
 * {| class="wikitable" width=50%

! A !! B !! a3 !! a2!! a1!! a0 !! Decimal Number
 * 0 || 0 || 0 || 0 || 0 || 0 || 0
 * 0 || 1 || 0 || 0 || 0 || 1 || 1
 * 1 || 0 || 0 || 0 || 1 || 0 || 2
 * 1 || 1 || 0 || 0 || 1 || 1 || 3
 * 1 || 1 || 0 || 1 || 0 || 0 || 4
 * 1 || 1 || 0 || 1 || 0 || 1 || 5
 * 1 || 1 || 0 || 1 || 1 || 0 || 6
 * 1 || 1 || 0 || 1 || 1 || 1 || 7
 * 1 || 1 || 1 || 0 || 0 || 0 || 8
 * 1 || 1 || 1 || 0 || 0 || 1 || 9
 * }
 * 1 || 1 || 0 || 1 || 0 || 1 || 5
 * 1 || 1 || 0 || 1 || 1 || 0 || 6
 * 1 || 1 || 0 || 1 || 1 || 1 || 7
 * 1 || 1 || 1 || 0 || 0 || 0 || 8
 * 1 || 1 || 1 || 0 || 0 || 1 || 9
 * }
 * 1 || 1 || 1 || 0 || 0 || 0 || 8
 * 1 || 1 || 1 || 0 || 0 || 1 || 9
 * }
 * }
 * }

ASCII Code
ASCII stands for American Standard Communication Information Interchange is the first standard introduced in North America for Information exchange. ASCII uses 7 bits Binary numbers to represent information in human language
 * 1) Number from 0 to 9
 * 2) Capital A to Z
 * 3) Common a to z

Code 0x20 (hexadecimal), the space character, denotes the space between words, as produced by the space-bar of a keyboard. The space character is considered an invisible graphic rather than a control character. Codes 0x21 to 0x7E, known as the printable characters, represent letters, digits, punctuation marks, and a few miscellaneous symbols.


 * {| class="wikitable" style="text-align: center; float:left;"

!Binary !! Oct !! Dec !! Hex !! Glyph
 * 010 0000 ||style="background:lightblue;"| 040 ||style="background:#CCFFFF;"| 32 ||style="background:lightblue;"| 20 || space
 * 010 0001 ||style="background:lightblue;"| 041 ||style="background:#CCFFFF;"| 33 ||style="background:lightblue;"| 21 || !
 * 010 0010 ||style="background:lightblue;"| 042 ||style="background:#CCFFFF;"| 34 ||style="background:lightblue;"| 22 || "
 * 010 0011 ||style="background:lightblue;"| 043 ||style="background:#CCFFFF;"| 35 ||style="background:lightblue;"| 23 || #
 * 010 0100 ||style="background:lightblue;"| 044 ||style="background:#CCFFFF;"| 36 ||style="background:lightblue;"| 24 || $
 * 010 0101 ||style="background:lightblue;"| 045 ||style="background:#CCFFFF;"| 37 ||style="background:lightblue;"| 25 || %
 * 010 0110 ||style="background:lightblue;"| 046 ||style="background:#CCFFFF;"| 38 ||style="background:lightblue;"| 26 || &
 * 010 0111 ||style="background:lightblue;"| 047 ||style="background:#CCFFFF;"| 39 ||style="background:lightblue;"| 27 || '
 * 010 1000 ||style="background:lightblue;"| 050 ||style="background:#CCFFFF;"| 40 ||style="background:lightblue;"| 28 || (
 * 010 1001 ||style="background:lightblue;"| 051 ||style="background:#CCFFFF;"| 41 ||style="background:lightblue;"| 29 || )
 * 010 1010 ||style="background:lightblue;"| 052 ||style="background:#CCFFFF;"| 42 ||style="background:lightblue;"| 2A || *
 * 010 1011 ||style="background:lightblue;"| 053 ||style="background:#CCFFFF;"| 43 ||style="background:lightblue;"| 2B || +
 * 010 1100 ||style="background:lightblue;"| 054 ||style="background:#CCFFFF;"| 44 ||style="background:lightblue;"| 2C || ,
 * 010 1101 ||style="background:lightblue;"| 055 ||style="background:#CCFFFF;"| 45 ||style="background:lightblue;"| 2D || -
 * 010 1110 ||style="background:lightblue;"| 056 ||style="background:#CCFFFF;"| 46 ||style="background:lightblue;"| 2E ||.
 * 010 1111 ||style="background:lightblue;"| 057 ||style="background:#CCFFFF;"| 47 ||style="background:lightblue;"| 2F || /
 * 011 0000 ||style="background:lightblue;"| 060 ||style="background:#CCFFFF;"| 48 ||style="background:lightblue;"| 30 || 0
 * 011 0001 ||style="background:lightblue;"| 061 ||style="background:#CCFFFF;"| 49 ||style="background:lightblue;"| 31 || 1
 * 011 0010 ||style="background:lightblue;"| 062 ||style="background:#CCFFFF;"| 50 ||style="background:lightblue;"| 32 || 2
 * 011 0011 ||style="background:lightblue;"| 063 ||style="background:#CCFFFF;"| 51 ||style="background:lightblue;"| 33 || 3
 * 011 0100 ||style="background:lightblue;"| 064 ||style="background:#CCFFFF;"| 52 ||style="background:lightblue;"| 34 || 4
 * 011 0101 ||style="background:lightblue;"| 065 ||style="background:#CCFFFF;"| 53 ||style="background:lightblue;"| 35 || 5
 * 011 0110 ||style="background:lightblue;"| 066 ||style="background:#CCFFFF;"| 54 ||style="background:lightblue;"| 36 || 6
 * 011 0111 ||style="background:lightblue;"| 067 ||style="background:#CCFFFF;"| 55 ||style="background:lightblue;"| 37 || 7
 * 011 1000 ||style="background:lightblue;"| 070 ||style="background:#CCFFFF;"| 56 ||style="background:lightblue;"| 38 || 8
 * 011 1001 ||style="background:lightblue;"| 071 ||style="background:#CCFFFF;"| 57 ||style="background:lightblue;"| 39 || 9
 * 011 1010 ||style="background:lightblue;"| 072 ||style="background:#CCFFFF;"| 58 ||style="background:lightblue;"| 3A || Colon (punctuation)
 * 011 1011 ||style="background:lightblue;"| 073 ||style="background:#CCFFFF;"| 59 ||style="background:lightblue;"| 3B || ;
 * 011 1100 ||style="background:lightblue;"| 074 ||style="background:#CCFFFF;"| 60 ||style="background:lightblue;"| 3C || <
 * 011 1101 ||style="background:lightblue;"| 075 ||style="background:#CCFFFF;"| 61 ||style="background:lightblue;"| 3D || =
 * 011 1110 ||style="background:lightblue;"| 076 ||style="background:#CCFFFF;"| 62 ||style="background:lightblue;"| 3E || >
 * 011 1111 ||style="background:lightblue;"| 077 ||style="background:#CCFFFF;"| 63 ||style="background:lightblue;"| 3F || ?
 * }
 * 011 0000 ||style="background:lightblue;"| 060 ||style="background:#CCFFFF;"| 48 ||style="background:lightblue;"| 30 || 0
 * 011 0001 ||style="background:lightblue;"| 061 ||style="background:#CCFFFF;"| 49 ||style="background:lightblue;"| 31 || 1
 * 011 0010 ||style="background:lightblue;"| 062 ||style="background:#CCFFFF;"| 50 ||style="background:lightblue;"| 32 || 2
 * 011 0011 ||style="background:lightblue;"| 063 ||style="background:#CCFFFF;"| 51 ||style="background:lightblue;"| 33 || 3
 * 011 0100 ||style="background:lightblue;"| 064 ||style="background:#CCFFFF;"| 52 ||style="background:lightblue;"| 34 || 4
 * 011 0101 ||style="background:lightblue;"| 065 ||style="background:#CCFFFF;"| 53 ||style="background:lightblue;"| 35 || 5
 * 011 0110 ||style="background:lightblue;"| 066 ||style="background:#CCFFFF;"| 54 ||style="background:lightblue;"| 36 || 6
 * 011 0111 ||style="background:lightblue;"| 067 ||style="background:#CCFFFF;"| 55 ||style="background:lightblue;"| 37 || 7
 * 011 1000 ||style="background:lightblue;"| 070 ||style="background:#CCFFFF;"| 56 ||style="background:lightblue;"| 38 || 8
 * 011 1001 ||style="background:lightblue;"| 071 ||style="background:#CCFFFF;"| 57 ||style="background:lightblue;"| 39 || 9
 * 011 1010 ||style="background:lightblue;"| 072 ||style="background:#CCFFFF;"| 58 ||style="background:lightblue;"| 3A || Colon (punctuation)
 * 011 1011 ||style="background:lightblue;"| 073 ||style="background:#CCFFFF;"| 59 ||style="background:lightblue;"| 3B || ;
 * 011 1100 ||style="background:lightblue;"| 074 ||style="background:#CCFFFF;"| 60 ||style="background:lightblue;"| 3C || <
 * 011 1101 ||style="background:lightblue;"| 075 ||style="background:#CCFFFF;"| 61 ||style="background:lightblue;"| 3D || =
 * 011 1110 ||style="background:lightblue;"| 076 ||style="background:#CCFFFF;"| 62 ||style="background:lightblue;"| 3E || >
 * 011 1111 ||style="background:lightblue;"| 077 ||style="background:#CCFFFF;"| 63 ||style="background:lightblue;"| 3F || ?
 * }
 * 011 1001 ||style="background:lightblue;"| 071 ||style="background:#CCFFFF;"| 57 ||style="background:lightblue;"| 39 || 9
 * 011 1010 ||style="background:lightblue;"| 072 ||style="background:#CCFFFF;"| 58 ||style="background:lightblue;"| 3A || Colon (punctuation)
 * 011 1011 ||style="background:lightblue;"| 073 ||style="background:#CCFFFF;"| 59 ||style="background:lightblue;"| 3B || ;
 * 011 1100 ||style="background:lightblue;"| 074 ||style="background:#CCFFFF;"| 60 ||style="background:lightblue;"| 3C || <
 * 011 1101 ||style="background:lightblue;"| 075 ||style="background:#CCFFFF;"| 61 ||style="background:lightblue;"| 3D || =
 * 011 1110 ||style="background:lightblue;"| 076 ||style="background:#CCFFFF;"| 62 ||style="background:lightblue;"| 3E || >
 * 011 1111 ||style="background:lightblue;"| 077 ||style="background:#CCFFFF;"| 63 ||style="background:lightblue;"| 3F || ?
 * }
 * 011 1101 ||style="background:lightblue;"| 075 ||style="background:#CCFFFF;"| 61 ||style="background:lightblue;"| 3D || =
 * 011 1110 ||style="background:lightblue;"| 076 ||style="background:#CCFFFF;"| 62 ||style="background:lightblue;"| 3E || >
 * 011 1111 ||style="background:lightblue;"| 077 ||style="background:#CCFFFF;"| 63 ||style="background:lightblue;"| 3F || ?
 * }
 * 011 1111 ||style="background:lightblue;"| 077 ||style="background:#CCFFFF;"| 63 ||style="background:lightblue;"| 3F || ?
 * }
 * }