9/15/09 - L3 CodesCopyright 2009 - Joanne DeGroat, ECE, OSU1 Codes.

Slides:



Advertisements
Similar presentations
KFUPM COE 202: Digital Logic Design Number Systems Part 3 Courtesy of Dr. Ahmad Almulhem.
Advertisements

Computer Codes Rohit Khokher. Computer Codes Data types NumericNonnumeric IntegerRealAlphabet A, B, C, …,Z a, b, c,…,z Digits 0,…,9 Special Characters.
The Binary Numbering Systems
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Using Binary Coding Information Remember  Bit = 0 or 1, Binary Digit  Byte = the number of bits used to represent letters, numbers and special characters.
Using Binary Coding Information Remember  Bit = 0 or 1, Binary Digit  Byte = the number of bits used to represent letters, numbers and special characters.
Overview Digital Systems and Computer Systems Number Systems [binary, octal and hexadecimal] Arithmetic Operations Base Conversion Decimal Codes [BCD (binary.
EECC341 - Shaaban #1 Lec # 3 Winter Binary Multiplication Multiplication is achieved by adding a list of shifted multiplicands according.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
Data Representation in Computers
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 1 Overflow Signed binary is in fixed range -2 n-1  2 n-1 If the answer for addition/subtraction more than the.
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Data Representation – Chapter 3 Sections 3-2, 3-3, 3-4.
Bits and Bytes.
COMPUTER FUNDAMENTALS David Samuel Bhatti
CODING SYSTEMS CODING SYSTEMS CODING SYSTEMS. CHARACTERS CHARACTERS digits: 0 – 9 (numeric characters) letters: alphabetic characters punctuation marks:
1.6 Signed Binary Numbers.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
9/15/09 - L15 Decoders, Multiplexers Copyright Joanne DeGroat, ECE, OSU1 Decoders and Multiplexers.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Programmable Logic Controllers
Binary Numbers and ASCII and EDCDIC Mrs. Cueni. Data Representation  Human speech is analog because it uses continuous signals (waves) that vary in strength.
Binary Codes Computers and other digital systems "work" with binary numbers. I/P & O/P is usually done using decimal numbers, alphabetics, special symbols.
Digital Systems and Logic Design
Binary Arithmetic & Data representation
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
The Digital Codes.
Digital Logic Lecture 4 Binary Codes The Hashemite University Computer Engineering Department.
Morgan Kaufmann Publishers
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
NUMBER SYSTEM AND COMPUTER CODES Chapter 2. Prelude Fingers, sticks, and other things for counting were not enough! Counting large numbers Count in groups.
Number Systems Spring Semester 2013Programming and Data Structure1.
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 2 – Binary Codes.
Introduction to Computer Design CMPT 150 Section: D Ch. 1 Digital Computers and Information CMPT 150, Chapter 1, Tariq Nuruddin, Fall 06, SFU 1.
Yuh-Jzer JoungDigital Systems1 Number Systems decimal number : 7397=7× × × ×10 0 a 4 a 3 a 2 a 1 a 0. a -1 a -2 = a 4 ×10 4 +a 3 ×10.
1 INFORMATION IN DIGITAL DEVICES. 2 Digital Devices Most computers today are composed of digital devices. –Process electrical signals. –Can only have.
CS151 Introduction to Digital Design
Chapter 1: Digital Computers and Information Illustration at beginning of each Chapter Base 10 Binary Base 2 Octal Base 8 Hex bas
Complements and Codes by Dr. Amin Danial Asham. References  Digital Design 5 th Edition, Morris Mano  Programmable Controllers-Theory and Implementation,
1 3 Computing System Fundamentals 3.5 Data Representation.
1 Lecture 3 ENGRE 254 1/14/09. 2 Lecture 1 review Digital signals assume two values represented by “0” and “1”. Typically a “0” represents a voltage near.
Chap 1. Digital Computers and Information Fall 2003 Sang-Hoon Oh Mokwon Univ.
Number Systems and Digital Codes
Codes by Dr. Amin Danial Asham. References  Programmable Controllers- Theory and Implementation, 2nd Edition, L.A. Bryan and E.A. Bryan.
Data Representation, Number Systems and Base Conversions
9/15/09 - L15 Decoders, Multiplexers Copyright Joanne DeGroat, ECE, OSU1 Decoders and Multiplexer Circuits.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
Agenda Character representation Numerical Conversions ASCII EBCDIC
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  The necessity and advantages of coding  The variety of coding systems You will learn: 2.
Module –I Codes: Weighted and non-weighted codes
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
ASCII AND EBCDIC CODES By : madam aisha.
Information Coding Schemes Group Member : Yvonne Tiffany Jurifah bt Junaidi Clara Jane George.
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Digital Logic & Design Adil Waheed Lecture 03. Range of Binary Numbers Processors can handle 64-bit unsigned binary values. Maximum unsigned decimal number.
The ASCII Alphanumeric Code What is it? Why use it? How do we use it?
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
Logic and Computer Design Fundamentals
Binary Numbers and ASCII and EDCDIC
Lecture No. 4 Number Systems
Fundamentals of Data Representation
COMS 161 Introduction to Computing
ECB2212-Digital Electronics Codes
COMS 161 Introduction to Computing
Learning Intention I will learn how computers store text.
Presentation transcript:

9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU1 Codes

9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU2 Class 3 outline  Alphanumeric Codes ASCII Parity  Gray Codes  Material from sections 1-5 and 1-6 of text

Human perception  We naturally live in a base 10 environment  Computer exist in a base 2 environment  So give the computer/digital system the task of doing the conversions for us. 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU3

Binary Codes  “An n-bit binary code is a group of n bits that assume up to 2 n distinct combinations of 1s and 0s, with each combination representing one element of the set being coded”  For the 10 digits need a 4 bit code. One code is called Binary Coded Decimal (BCD) 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU4

Decimal and BCD  The BCD is simply the 4 bit representation of the decimal digit.  For multiple digit base 10 numbers, each symbol is represented by its BCD digit  What happened to 6 digits not used? 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU5

BCD operation  Consider the following BCD operation Decimal: Add Covert to binary And Getting Which is still a BCD representation of a decimal digit 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU6

Another  A second example Getting 6 or And in range and a BCD digit representation 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU7

And now  Consider    giving which is binary 10 but not a BCD digit!  What to do?  Try adding 6?? 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU8

Adding 6  Had 1010 and want to add 6 or 0110 so plus Giving  Or a carry out to the next binary digit, or if the binary in BCD, the next BCD digit. 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU9

Another carry example  Add have plus Giving and again out of range Adding Giving so a 1 carries out to the next BCD digit FINAL BCD answer or /15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU10

Multibit BCD  Add the BCD for 417 to 195  Would expect to get 612 BCD setup - start with Least Significant Digit Adding Gives /15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU11

Continuing multibit  Had a carry to the 2 nd BCD digit position done Again must add Giving And another carry 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU12

Still Continuing multibit  Had a carry to the 3rd BCD digit position donedone And answer is or the BCD for the base 10 number 612 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU13

Alphanumeric Codes  How do you handle alphanumeric data?  Easy answer!  Formulate a binary code to represent characters!  For the 26 letter of the alphabet would need 5 bit for representation.  But what about the upper case and lower case, and the digits, and special characters 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU14

A code called ASCII  ASCII stands for American Standard Code for Information Interchange  The code uses 7 bits to encode 128 unique characters  Reference the textbook, pg. 27, for a table of the ASCII code  As a note, formally, work to create this code began in st standard in Last updated in /15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU15

ASCII Code  Represents the numbers All start 011 xxxx and the xxxx is the BCD for the digit  Represent the characters of the alphabet Start with either 100, 101, 110, or 111 A few special characters are in this area  Start with 010 – space and !”#$%&’()*+.-,/  Start with 000 or 001 – control char like ESC 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU16

ASCII Example  Encoding of  Encoding of Joanne  Note that these are 7 bit codes 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU17

What to do with the 8 th Bit?  In digital systems data is usually organized as bytes or 8 bit of data.  How about using the 8 th bit for an error coding. This would help during data transmission, etc.  Parity bit – the extra bit included to make the total number of 1s in the byte either even or odd – called even parity and odd parity 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU18

Example of Parity  Consider data Even Parity Odd Parity  Consider data Even Parity Odd Parity  A parity code can be used for ASCII characters and any binary data. 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU19

Other Character Codes  Once upon a time, a long, long time ago, there existed cards, called punch cards! And a code for those cards called Hollerith code. (patented in 1889) The code told you what character was being represented in a column when there was a punch out in various rows of that column.  And another code for characters called EBCDIC (Extended Binary Coded Decimal Interchange Code) (1963, 1964 IBM) - similar to ASCII – Digits are coded F0 through F9 in EBCDIC 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU20

Gray Codes  When you count up or down in binary, the number of bit that change with each digit change varies. From 0 to 1 just have a single but From 1 to 2 have 2 bits, a 1 to 0 transition and a 0 to 1 transition From 7 to 8 have 3 bits changing back to 0 and 1 bit changing to a 1  For some applications multiple bit changes cause significant problems. 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU21

Gray Code  Contrast of bit changes ValBinChgGrayChg /15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU22

Gray Code Encoder  Copy of figure 1-5 from text 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU23

Class 3 assignment  Covered sections 1-5 and 1-6  Problems for hand in 1-22, 1-23  Problems for practice 1-25, 1-26  Reading for next class: sections 2-1 and 1 st 3 pages of 2-2 9/15/09 - L3 CodesCopyright Joanne DeGroat, ECE, OSU24