1 / 12

ELEC1700 Computer Engineering 1 Week 6 Wednesday lecture Codes Semester 1, 2013

ELEC1700 Computer Engineering 1 Week 6 Wednesday lecture Codes Semester 1, 2013. Gray code is an unweighted code Bits in a codeword do not have weight 2 0 , 2 1 , 2 2 etc Key property of Gray code: a single bit changes between one codeword and the next in the counting sequence

kitra
Download Presentation

ELEC1700 Computer Engineering 1 Week 6 Wednesday lecture Codes Semester 1, 2013

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ELEC1700Computer Engineering 1Week 6 Wednesday lecture Codes Semester 1, 2013

  2. Gray code is an unweighted code Bits in a codeword do not have weight 20, 21, 22 etc Key property of Gray code: a single bit changes between one codeword and the next in the counting sequence Common application: shaft position (angle) encoders Gray code Decimal Binary Gray code 0 1 2 3 4 5 6 7 8 9 10 11 12 13 1415 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000

  3. Application of Gray codes: shaft encoder • Infrared (IR) emitter/detectors detect position of the shaft • 3 rings → 3-bit encoder (practical encoders: ten or more bits) • Each sector is either reflective or non-reflective • Gray encoding avoids errors due to multiple bit changes Binary code sequence Gray code sequence

  4. Square scanning head 000 001 010 011 100 101 110 111 000 Expected counts: Shaft encoder: binary code Most significant bit (MSB)

  5. Skewed scanning head 000 001 010 011 100 101 110 111 000 Expected counts: 010 100 110 100 000 000 Undesiredintermediate counts: Shaft encoder: binary code Intermediate counts on transitions can cause major errors in angle readings

  6. Square scanning head 000 001 011 010 110 111 101 100 000 Expected counts: Shaft encoder: Gray code

  7. Skewed scanning head 000 001 011 010 110 111 101 100 000 Expected counts: Note no undesiredintermediate counts Shaft encoder: Gray code Gray code eliminates problems with intermediate counts on transitions

  8. Alphanumeric codes • Alphanumeric codes represent alphabetic characters (letters), punctuation and numbers • Most common alphanumeric code is ASCII • American Standard Code for Information Interchange • ASCII: 128 characters represented by a 7-bit code • or an 8-bit code with MSB=0 • 95 printable characters + 33 non-printable “control characters” • Beyond ASCII: • Extended ASCII (8 bits) • Unicode: 110,000+ characters in 100+ scripts; 4 or 5 hex digits Remember: 27 = 128

  9. sequence of ASCII codes for C program statement if (x>5) • Symbol Hexadecimal Binary • i 6916 1101001 • f • space • ( • x • > • 5 • )

  10. Error detection codes communication systems often use a parity bit for error detection parity bit is an extra bit attached to a group of bits to force the number of 1’s in the extended group to be either even (even parity) or odd (odd parity) transmitter and receiver need to agree to use even or odd parity an example of a communication protocol receiver flags error if number of bits in received word does not satisfy agreed parity condition Receiver might request retransmission How many bits in received word are wrong?

  11. Error correction codes • Parity bits are redundant but allow error detection • Basic idea can be extended to forward error-correcting (FEC) codes • “forward” because codes can be used to actually correct errors without retransmission • not just detect errors and ask for the transmitter to send the information again • FEC codes are used (almost) everywhere in digital communications • CD, DVD, hard disks, digital television, fibre-optics, mobile phones, WLANs, modems, …

  12. Error correction codes Simple error correction code Message: 101001 Transmit codeword: 111000111000000111 Receive: 110000111000001110 Decoder decides: 111000111000000111 Decoded message: 101001 Good codes… add low redundancy correct many errors Best known codes are called low-density parity-check (LDPC) codes

More Related