Digital System Design Lecture 1 - Number Systems and Code Instructors: Dr. Nguyen Tuan Khanh, postdoc, khanh.nt@vgu.edu.vn M.Sc. Nguyen Vo That Thuyet, lab engineer, thuyet.nvt@vgu.edu.vn Electrical and Computer Engineering (ECE) Faculty of Engineering, Vietnamese-German University, Vietnam Sep. 2024 1 Outline •Binary-to-Decimal Conversions •Putting It All Together •Decimal-to-Binary Conversions •The Byte, Nibble, and Word •Hexadecimal Number System •Alphanumeric Codes •BCD Code •The Gray Code •Parity Method for Error Detection •Applications Binary-to-Decimal Conversions LSB MSB Decimal-to-Binary Conversions Decimal-to-Binary Conversions •Repeated Division Decimal-to-Binary Conversions •Repeated Division Start Is Q = 0 Divide by 2 Record quotient (Q) and remainder (R) Collect R’s into desired binary number with first as LSB and last R as MSB Start Decimal-to-Binary Conversions •Counting Range Using N bits, we can represent decimal numbers ranging from 0 to 2N -1, a total of 2N different numbers Hexadecimal Number System Hexadecimal Number System •Hex-to-Decimal Conversion Hexadecimal Number System •Decimal-to-Hex Conversion Hexadecimal Number System •Hex-to-Binary Conversion Hexadecimal Number System •Binary-to-Hex Conversion •Counting in Hexadecimal •Usefulness of Hex Conversion Summary •Why is conversion is necessary? •Summary •Binary/Hex 🡪 Decimal •Decimal 🡪 Binary/Hex •Hex 🡪 Binary •Binary 🡪 Hex BCD Code •Decimal ↔ Straight binary coding •Binary-coded-decimal (hereafter abbreviated BCD) •Comparison of BCD and Binary The Gray Code •Only one bit ever changes between two successive numbers in the sequence The Gray Code •Converting (a) binary to Gray and (b) Gray to binary The Gray Code •An eight-position, three-bit shaft encoder. Putting All Together The Byte, Nibble, and Word •Byte •Nibble •Word Alphanumeric Codes •All of the various characters and functions that are found on a computer keyboard •A, B, C, …, a, b, c, …, 1, 2, 3, …, ., ,, ?, …, +, /, #, … •American Standard Code for Information Interchange (ASCII) •27 = 128 possible code groups •Transfer of alphanumeric info.: a computer ↔ external devices •Store the information that an operator types in at the computer’s keyboard. Alphanumeric Codes •Example padding with 0s Parity Method for Error Detection •Movement of binary data and codes from one location •Error can occur •Electrical noise •Detection code •Correction code Parity Method for Error Detection •Parity bit •Even-parity method •Odd-parity method •Detection code, not correction code •Single-bit error detection •Checking the parity, request for retransmission, retransmission Applications • Transmitting an ASCII character (Application 2-5) • Example: transmit a Delete