Skip to content
DLVSDigital Logic Visualizing System

Logic Lab

Binary Codes

ASCII and EBCDIC side by side, plus parity error detection with a working XOR-gate checker.

ASCII, EBCDIC and error detection

Parity
CharASCII hexASCII binary (7 bit)EBCDIC hexEBCDIC binaryParity bit
H481001000C8110010000
i69110100189100010010
␣20010000040010000001
5350110101F5111101010

ASCII uses 7 bits (128 characters). EBCDIC is IBM’s 8-bit code, where letters come in three separate runs (A–I, J–R, S–Z) instead of one. Only plain ASCII characters are listed here.

Parity check on “H”

The sender adds a parity bit (leftmost) so the number of 1s is even. Tap bits to damage the word in transit.

P
D6
D5
D4
D3
D2
D1
D0

Parity checker made from XOR gates

0P1D60D50D41D30D20D10D0Error=0

Each XOR gate adds two bits without a carry, so the last gate outputs the parity of all eight bits. For even parity the word is good when that parity is 0, so Error = 1 means an odd number of 1s. The sender uses the same tree over the seven data bits to make the parity bit.

Sent01001000
Received01001000
Number of 1s2
Receiver saysno error seen

Nothing damaged.

A single parity bit detects any odd number of flipped bits and misses any even number. It detects but does not correct. Hamming codes add several parity bits so the position of a single error can be found.