© 2003-2008 BYU 02 NUMBERS Page 1 ECEn 224 Binary Number Systems and Codes.

Slides:



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

Number Systems and Codes
DATA REPRESENTATION CONVERSION.
Data Representation Computer Organization &
Data Representation COE 205
Binary Representation
Representing Information as Bit Patterns Lecture 4 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Number Systems Decimal (Base 10) Binary (Base 2) Hexadecimal (Base 16)
March 2006Taner Erig - EMU2-1 Metamorphosis of Information How is information represented and how do computers store information?
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
IT-101 Section 001 Lecture #4 Introduction to Information Technology.
Computer Fluency Binary Systems. Humans Decimal Numbers (base 10) Decimal Numbers (base 10) Sign-Magnitude (-324) Sign-Magnitude (-324) Decimal Fractions.
 Binary Binary  Binary Number System Binary Number System  Binary to Decimal Binary to Decimal  Decimal to Binary Decimal to Binary  Octal and Hexadecimal.
ENEL 111 Digital Electronics Richard Nelson G.1.29
Representing Information in Binary (Continued)
CIS 234: Character Codes Dr. Ralph D. Westfall April, 2011.
Hexadecimal and ASCII Lesson Objective: Understand the purpose of ASCII and how to use it. Lesson Outcome: Convert between Hexadecimal and ASCII Convert.
Chapter 3 Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis.
Representing text Each of different symbol on the text (alphabet letter) is assigned a unique bit patterns the text is then representing as.
Computers Organization & Assembly Language
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Data Representation S2. This unit covers how the computer represents- Numbers Text Graphics Control.
The number systems of Computer Science
Chapter 3 Data Representation
Dept. of Computer Science Engineering Islamic Azad University of Mashhad 1 DATA REPRESENTATION Dept. of Computer Science Engineering Islamic Azad University.
Ahmad Almulhem, KFUPM 2010 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Representing Data. Representing data u The basic unit of memory is the bit  A transistor that can hold either high or low voltage  Conceptually, a tiny.
Lec 3: Data Representation Computer Organization & Assembly Language Programming.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
1.7 BINARY CODES BCD Code (Binary –Coded Decimal ) BCD Addition
CS151 Introduction to Digital Design
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
CE1111 :Digital Logic Design lecture 01 Introduction Dr. Atef Ali Ibrahim.
1 Chapter 2 Number Systems, Operations, and Codes.
Number Systems and Codes
Number Systems Decimal (Base 10) –10 digits (0,1,2,3,4,5,6,7,8,9) Binary (Base 2) –2 digits (0,1) Digits are often called bits (binary digits) Hexadecimal.
EET 250 Number systems. Introduction to Number Systems While we live in a world where the decimal number is predominant in our lives, computers and digital.
Data Representation, Number Systems and Base Conversions
Hexadecimal Data Representation. Objectives  Know how the Hexadecimal counting system works  Be able to convert between denary, binary & hexadecimal.
Ahmad Almulhem, KFUPM 2009 COE 202: Digital Logic Design Number Systems Part 4 Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:
Binary01.ppt Decimal Decimal: Base 10 means 10 Unique numerical digits ,00010,000 Weight Positions 3,
Signed Binary Numbers Arithmetic Subtraction – In 2’s-complement form: Example: 1.Take the 2’s complement of the subtrahend (including the sign bit) and.
NUMBER SYSTEMS AND CODES. CS Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
The Hexadecimal System is base 16. It is a shorthand method for representing the 8-bit bytes that are stored in the computer system. This system was chosen.
 Method of representing or encoding numbers  Two main notation types  Sign-value  Roman numerals  Positional (place-value)  Modern decimal notation.
Binary a. express numbers in binary, binary-coded decimal (BCD), octal and hexadecimal;
Base 16 (hexadecimal) Uses the decimal digits and the first letters of the alphabet to encode 4 binary bits (16=2 4 ) abcdef or ABCDEF.
1.4 Representation of data in computer systems Character.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Computer Science 210 Computer Organization
Number Systems and Codes
Chapter 3 Data Representation Text Characters
NUMBER SYSTEMS.
Lec 3: Data Representation
Unit 18: Computational Thinking
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Data Encoding Characters.
Number Systems and Codes
Numbering System TODAY AND TOMORROW 11th Edition
Data Representation Conversion 05/12/2018.
Computer Science 210 Computer Organization
Presenting information as bit patterns
COMS 161 Introduction to Computing
Number Systems Lecture 2.
COMS 161 Introduction to Computing
Learning Intention I will learn how computers store text.
Information Representation
Digital Representation of Data
Presentation transcript:

© BYU 02 NUMBERS Page 1 ECEn 224 Binary Number Systems and Codes

© BYU 02 NUMBERS Page 2 ECEn 224 Positional Numbers What does really mean? Depends on the number base! Assuming base 10: = 5x x x x x x10 -2 Assuming base 6: = 5x x x x x x6 -2 We often use a subscript to indicate the base.

© BYU 02 NUMBERS Page 3 ECEn 224 Positional Number Examples = (5 x 10 2 ) + (2 x 10 1 ) + (7 x 10 0 ) + (4 x ) + (6 x ) = (5 x 8 2 ) + (2 x 8 1 ) + (7 x 8 0 ) + (4 x 8 -1 ) + (6 x 8 -2 ) = illegal why? = (1 x 2 3 ) + (0 x 2 2 ) + (1 x 2 1 ) + (1 x 2 0 ) + (1 x 2 -1 ) + (1 x 2 -2 ) This works for binary as well…

© BYU 02 NUMBERS Page 4 ECEn 224 Conversion from Binary Convert to base 10: = 1x x x x x x x x2 -2 = ½ + ¼ =

© BYU 02 NUMBERS Page 5 ECEn 224 Convert to binary: x x x x x x x = Read this way This method also works for fractional numbers.

© BYU 02 NUMBERS Page 6 ECEn An Alternate Method R 0 28 R 1 14 R 0 7 R 0 3 R 1 1 R 1 0 R = Read this way

© BYU 02 NUMBERS Page 7 ECEn 224 Converting fractions from base 10 to binary: Convert to binary 0.7 x 2 (1).4 x 2 (0).8 x 2 (1).6 x 2 (1).2 x 2 (0).4 x 2 (0).8 process starts repeating here = … 2 Read this way

© BYU 02 NUMBERS Page 8 ECEn 224 Convert to binary: We could use the first technique x x x x x x x x x x … Read this way =

© BYU 02 NUMBERS Page 9 ECEn 224 Convert to binary: Or we could combine the second and third techniques = R 0 28 R 1 14 R 0 7 R 0 3 R 1 1 R 1 0 R x 2 (1).4 x 2 (0).8 x 2 (1).6 x 2 (1).2 x 2 (0).4 x 2 (0).8 Read this way

© BYU 02 NUMBERS Page 10 ECEn 224 Hexadecimal Commonly used for binary data –1 hex digit  4 binary digits (bits) Need more digits than just 0-9 –Use 0-9, A-F A-F are for FA2 16 = 15x x x16 0 FA2 16 = Each group of 4 bits  1 hex digit

© BYU 02 NUMBERS Page 11 ECEn 224 Other Notations For Binary and Hex Binary – –10110b –0b10110 Hexadecimal – –0x573 –573h –16#573

© BYU 02 NUMBERS Page 12 ECEn 224 Other Codes BCD ASCII Gray

© BYU 02 NUMBERS Page 13 ECEn 224 Binary Coded Decimal (BCD) Convert to BCD Code Note this is very different from converting to binary which yields:

© BYU 02 NUMBERS Page 14 ECEn 224 Binary Coded Decimal (BCD) Why use BCD? In some applications it may be easier to work with Financial institutions must be able to represent base 10 fractions (e.g., 1/10) – = … 2 –Using BCD ensures that numeric results are identical to base 10 results

© BYU 02 NUMBERS Page 15 ECEn 224 Binary Codes ASCII Code ASCII  American Standard Code for Information Interchange ASCII is a 7-bit code used to represent letters, symbols, and terminal codes There are also Extended ASCII codes, represented by 8-bit numbers Terminal codes include such things as: Tab (TAB) Line feed (LF) Carriage return (CR) Backspace (BS) Escape (ESC) And many more!

© BYU 02 NUMBERS Page 16 ECEn 224 Binary Codes ASCII Code

© BYU 02 NUMBERS Page 17 ECEn 224 Binary Codes Extended ASCII Code

© BYU 02 NUMBERS Page 18 ECEn 224 Binary Codes ASCII Code (partial) Convert “help” to ASCII h e l p x68 0x65 0x6C 0x70

© BYU 02 NUMBERS Page 19 ECEn 224 Binary Codes Gray Code Only one bit changes with each number increment Not a weighted code Useful for interfacing to some physical systems

© BYU 02 NUMBERS Page 20 ECEn 224 Gray Codes are Not Unique

© BYU 02 NUMBERS Page 21 ECEn 224 Codes - Summary Bits are bits… –Modern digital devices represent everything as collections of bits –A computer is one such digital device You can encode anything with sufficient 1’s and 0’s –Text (ASCII) –Computer programs (C code, assembly code, machine code) –Sound (.wav,.mp3, …) –Pictures (.jpg,.gif,.tiff)