ECE 3110: Introduction to Digital SystemsPrevious class SummaryBinary Codes for Decimal NumbersBCD codeSlide 5Weighted codeExcess-3 codeGray CodeSlide 9How to construct Gray CodeAnother method to construct Gray CodeOther codesCodes for Actions/Conditions/StatesSlide 14Codes for serial data transmission and storageSlide 16Next…ECE 3110: Introduction to Digital SystemsBCD, Gray, Character, Action/Event, Serial Data2Previous class SummarySigned Addition/subtractionOverflowSign extensionUnsigned multiplication/divisionShift-and-addShift-and-subtract3Binary Codes for Decimal NumbersCode: A set of n-bit strings in which different bit strings represent different numbers or other things.Code word: a particular combination of n-bit valuesN-bit strings at most contain 2n valid code words.To represent 10 decimal digits, at least need 4 bits. Excessive ways to choose ten 4-bit words. Some common codes:BCD: Binary-coded decimal, also known as 8421 codeExcess-32421…4BCD code0000:0 ….1001: 9Packaged-BCD representation:8 bits (one byte) represent 0---99BCD additionSimilar to add 4-bit unsigned binary numbers.Make correction if a result exceeds 1001 (9). By adding 0110 (6).Carry into the next digit position may come from either the initial binary addition or the correction-factor addition.56Weighted codeEach decimal digit can be obtained from its code word by assigning a fixed weight to each code-word bit.BCD (8,4,2,1)2421 (self-complementing: code word for the 9’s complement of any digit may be obtained by complementing the individual bits of the digit’s code word)7Excess-3 codeSelf-complementing codeNot weightedCorresponding BCD code + 00112 Binary counters8Gray CodeOnly one bit changes between each pair of successive words.For example:3-bit Gray Code910How to construct Gray CodeRecursivelyA 1-bit Gray Code has 2 code words, 0, 1The first 2n code words of an (n+1)-bit Gray code equal the code words of an n-bit Gray Code, written in order with a leading 0 appended.The last 2n code words equal the code words of an n-bit Gray Code, but written in reverse order with a leading 1 appended.11Another method to construct Gray CodeThe bits of an n-bit binary or Gray-code word are numbered from right to left, from 0 to n-1Bit i of a Gray code word is0 if bits i and i+1 of the corresponding binary code words are the same1: otherwise12Other codesCharacter codes (nonnumeric)ASCII (7-bit string)Codes for action/condition/statesCodes for Detecting and Correcting ErrorsCodes for Serial Data Transmission13Codes for Actions/Conditions/StatesIf there are n different actions, conditions, or states, we can represent them with a b-bit binary code with Ceiling function: the smallest integer greater than or equal to the bracketed quantity. nb2log1415Codes for serial data transmission and storageParallel data: disk storageSerial data: telephone networkBit rates: bps, numerically equals to the clock frequency (Hz)Bit time: reciprocal of bit rateBit cell: time occupied by each bit.Line code: format of actual signal on the line, NRZ (Non-Return-to-Zero)Synchronization signal: identify the significance of each bit in the stream.1617Next…Class ReviewExam: Close books, but you may bring one sheet of notes.No Calculators are allowed in this
View Full Document