Electronic Systems: Binary Codes
Electronic Systems: Binary Codes
Topic 4
BINARY CODES
2
Electronic Systems. Topic 4
BINARY CODES
Digital signal:
Electric signal that may vary over time but that can only take a
finite set of values.
Digital signals
Binary signal:
Digital signal that con only take two possible values.
Normally denoted as (H) High and (L)Low or as “1” and “0”.
3
Electronic Systems. Topic 4
BIT, NIBBLE, BYTE, WORD
Nibble
Set of four bits.
Byte (Octet)
Set of eight bits.
Word
Fixed-sized piece of data handled as a unit by the
instruction set or the hardware of a processor
(Wikipedia). Usual word-lengths: 8, 16, 32, 64 bits.
Decimal → Binary:
1. Number systems and base change
• Integer part: Divide integer part into two until quotient equals zero. The
code is made up of the residuals, with first one being LSB.
• Fractional part: Multiply fractional part by two until result does not have
fractional part or enough digits are known. The code is made up of the
integer part of the result of each multiplication.
001001112 = 0·27+0·26+1·25+0·24+0·23+1·22+1·21+1·20 =
32+4+2+1 = 3910
8
Electronic Systems. Topic 4
NON-BINARY NUMBER SYSTEMS
9
Electronic Systems. Topic 4
NON-BINARY NUMBER SYSTEMS
11
Electronic Systems. Topic 4
NON-POSITIONAL NUMBER SYSTEMS
1001010001BCD = 25110
0010 0101 0001
2 5 1
011100110001BCD = 73110
12
Electronic Systems. Topic 4
A COMPARISON
0000 0000 00 0
0001 0001 01 1
0010 0010 02 2
0011 0011 03 3
0100 0100 04 4
0101 0101 05 5
0110 0110 06 6
0111 0111 07 7
1000 1000 08 8
1001 1001 09 9
1010 0001 0000 10 A
1011 0001 0001 11 B
1100 0001 0010 12 C
1101 0001 0011 13 D
1110 0001 0100 14 E
1111 0001 0101 15 F
13
Electronic Systems. Topic 4
NON-POSITIONAL NUMBER SYSTEMS
• ASCII
American Standard Code for Information
1. Number systems and base change
Interchange.
Character encoding standard for electronic
communication.
Uses seven (7) bits.
Allows to encode alphabet letters, decimal digits,
punctuation marks, and control characters.
There exists an international encoding standard
that extends ASCII to eight (8) bit: ISO/IEC 8859.
14
Electronic Systems. Topic 4
NON-POSITIONAL NUMERAL SYSTEMS
• Codi ASCII
1. Number systems and base change
15
Electronic Systems. Topic 4
BIBLIOGRAPHY
Floyd. Pearson
16
Electronic Systems. Topic 4