














Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!















Decimal BCD N B 0 B 1 B 2 B 3 0 0 0 0 0 1 0 0 0 1 2 0 0 1 0 3 0 0 1 1 4 0 1 0 0 5 0 1 0 1 6 0 1 1 0 7 0 1 1 1 8 1 0 0 0 9 1 0 0 1
S 0 S 1 Enc
S 9
B (^0)
B (^3)
Characters o General term used for letters, digits and punctuation o Each character is assigned a unique numerical code o How many codes are needed? o Digits (10): 0, 1, 2, 3,…, 9 o Lower case letters (26): a, b, c,…, z o Upper case letters (26): A, B, C,…, Z o Punctuation (16):. , ; :?! “ ‘ ` { } [ ] ( ) o Special characters (18): # $ € ¥ £ % ^ & * + - = \ / < > | ~ o Other characters: § © ® ¶ ± ¢ ¼ o Characters for other languages : ß â ç ê ţ Њ љ Ω ּפ
ASCII code o 7 bits allocated to store each code o 27 = 128 codes for 128 possible characters o Covers digits, lower and upper case letters, punctuation, special and other characters o Does not cover characters for other languages (accents, umlauts, fadas)
0 1 2 3 4 5 6 7 8 9 A B C D E F 0 NUL SOH STX ETX EOT ENQ ACK BEL BS HT LF VT FF CR SO SI 1 DLE DC1 DC2 DC3 DC4 NAK SYN ETB CAN EM SUB ESC FS GS RS US 2 SP! " # $ % & ' ( ) * + , -. / 3 0 1 2 3 4 5 6 7 8 9 : ; < = >? 4 @ A B C D E F G H I J K L M N O 5 P Q R S T U V W X Y Z [ \ ] ^ _ 6 ` a b c d e f g h i j k l m n o 7 p q r s t u v w x y z { | } ~ DEL
Extended ASCII
o Specified by International Standards Organization-ISO o A subset of ISO-8859 that includes several sets of characters for writing in Cyrillic, Arabic, Hebrew, etc. o Extends ASCII, including additional characters used in some West European languages such as Irish, French and German o One byte (8 bits) allocated to store each code o 28 = 256 codes for 256 possible characters o Text encoded in Extended ASCII can be transmitted through e-mail and be printed on any computer system, being accepted as basis for every text file formats o E.g. ‘a’ <=> 97 10 = 1100001 2 = 61 16
Decimal 9 7 Binary 0 1 1 0 0 0 0 1 Hexadecimal 6 1
Words (Strings)
o A word is represented as a sequence of 0 or more characters in form of a string or an array of characters o E.g. “ee201” = [‘e’, ‘e’, ‘2’, ‘0’, ‘1’] (^) ASCII = [101, 101, 50, 48, 49] 10 = [65, 65, 32, 30, 31] (^16)
Binary 0 1 1 0 0 1 0 1 Hex 6 5 Binary 0 1 1 0 0 1 0 1 Hex 6 5 Binary 0 0 1 1 0 0 1 0 Hex 3 2 Binary 0 0 1 1 0 0 0 0 Hex 3 0 Binary 0 0 1 1 0 0 0 1 Hex 3 1
Decimal Gray Code N G 0 G 1 G 2 G 3 0 0 0 0 0 1 0 0 0 1 2 0 0 1 1 3 0 0 1 0 4 0 1 1 0 5 0 1 1 1 6 0 1 0 1 7 0 1 0 0 8 1 1 0 0 9 1 1 0 1 10 1 1 1 1 11 1 1 1 0 12 1 0 1 0 13 1 0 1 1 14 1 0 0 1 15 1 0 0 0
B (^0)
G (^0)
B 1 B 2 B 3 B 4
G (^1) G 2 G 3 G (^4)
Binary Number Gray Code B 0 B 1 B 2 B 3 G 0 G 1 G 2 G 3 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 0 1 1 0 0 1 0 0 1 0 0 0 1 1 0 0 1 0 1 0 1 1 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 1 0 1 0 1 1 1 1 1 0 1 1 1 1 1 0 1 1 0 0 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 1 0 0 1 1 1 1 1 1 0 0 0
The 1-st bit of the binary code (the most significant) is the same as the 1-st bit of the corresponding Gray code
The 2-nd bit of the binary code is 1 if the 1-st bit of the binary code and the 2-nd bit of the Gray code are different and 0 if they are the same … The N-th bit of the binary code is 1 if the (N-1)-th bit of the binary code and the N-th bit of the Gray code are different and 0 if they are the same
G (^0)
B 0
G 1 G 2 G 3 G (^4)
B (^1) B 2 B 3 B (^4)
o E.g. ‘a’ <=ASCII=> 97 10 = 1100001 2
o E.g. 111010011100001 2
o E.g. ‘a’ <=ASCII=> 97 10 = 1100001 2
ASCII Decimal 9 7 ASCII Binary 1 1 0 0 0 0 1 ASCII Hexa 6 1 Even Parity Code 1 1 1 0 0 0 0 1 Even Parity Code Hex E 1
Binary 1 1 1 0 1 0 0 1 1 1 0 0 0 0 1 Hexa 7 4 E 1 Even Parity Code 0 1 1 1 0 1 0 0 1 1 1 0 0 0 0 1
Even Parity Code Hex 7 4 E 1
ASCII Decimal 9 7 ASCII Binary 1 1 0 0 0 0 1 ASCII Hex 6 1 Even Parity Code 0 1 1 0 0 0 0 1 Even Parity Code Hex 6 1
Even parity bit
Even parity bit
Odd parity bit
Parity Generator (^) CheckerParity
A B C
D
A
B C D
Parity Bit (^) IndicatorError
o Using a single parity bit, errors in transmission of binary data sequences (words) can be detected
o Only singular errors can be detected (errors that affect only one bit) or multiple errors if odd number of bits are affected
o This setup cannot detect where the error takes place and therefore it cannot be corrected
Hamming code enables single errors to be detected and corrected
P1, P2, P4, P8, P16, …
Bit position 8 4 2 1 Parity bit 1 0 0 0 1 P 2 0 0 1 0 P 3 0 0 1 1 P1, P 4 0 1 0 0 P 5 0 1 0 1 P1, P 6 0 1 1 0 P2, P 7 0 1 1 1 P1, P2, P 8 1 0 0 0 P 9 1 0 0 1 P1, P 10 1 0 1 0 P2, P
P
P1 -> P1, D3, D5, D7, D9, …
P2 -> P2, D3, D6, D7, D10, D11, … P4 -> P4, D5, D6, D7, D12, D13, D14, D15, … P8 -> P8, D9, D10, D11, D12, D13, D14, D15, …
P1, P2, D3, P4, D5, D6, D7, P8, D9, D10, D11, …
Encoding and Transmission
P1 P2 D3 P4 D5 D6 D 1 0 1 0
C8 C4 C2 C1 Error bit 0 0 0 0 None 0 0 0 1 P 0 0 1 0 P 0 0 1 1 D 0 1 0 0 P 0 1 0 1 D 0 1 1 0 D 0 1 1 1 D 1 0 0 0 P 1 0 0 1 D 1 0 1 0 D
P1 -> P1, D3, D5, D7 <=> P1, 1, 0, 0 => P1 = 1
P2 -> P2, D3, D6, D7 <=> P2, 1, 1, 0 => P2 = 0 P4 -> P4, D5, D6, D7 <=> P4, 0, 1, 0 => P4 = 1
Error Detection and Correction
P1 P2 D3 P4 D5 D6 D 1 0 1 1 0 1 0
P1 P2 D3 P4 D5 D6 D 1 0 0 1 0 1 0