Binary Arithmetic & Data representation

Slides:



Advertisements
Similar presentations
Computer Codes Rohit Khokher. Computer Codes Data types NumericNonnumeric IntegerRealAlphabet A, B, C, …,Z a, b, c,…,z Digits 0,…,9 Special Characters.
Advertisements

ICS312 Set 2 Representation of Numbers and Characters.
Lecture - 2 Number systems and computer data formats
Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
2’s Complement Arithmetic (remember it’s a fixed length system)
Chapter 2 : Number System
Digital Fundamentals Floyd Chapter 2 Tenth Edition
1 CSE1301 Computer Programming Lecture 28 Number Representation (Integer)
SYEN 3330 Digital Systems Jung H. Kim Chapter 1 1 SYEN 3330 Digital Systems Chapter 1.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
Number System and Codes
Data Representation – Chapter 3 Sections 3-2, 3-3, 3-4.
FIGURES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Data Storage. SIGN AND MAGNITUDE Storing and representing numbers.
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.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Chapter 3 Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis.
Introduction to Number Representation F451 Year 10 Computing Binary Numbers Binary Numbers Sign/Magnitude Sign/Magnitude 2s Complement 2s Complement Binary.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
Binary Codes Computers and other digital systems "work" with binary numbers. I/P & O/P is usually done using decimal numbers, alphabetics, special symbols.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
COMPSCI 210 Semester Tutorial 1
NUMBER SYSTEM AND COMPUTER CODES Chapter 2. Prelude Fingers, sticks, and other things for counting were not enough! Counting large numbers Count in groups.
ICS312 Set 1 Representation of Numbers and Characters.
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.
Computer Systems Architecture Copyright © Genetic Computer School 2008 CSA 1- 0 Lesson 1 Number System.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Summer 2012ETE Digital Electronics1 Binary Arithmetic of Signed Binary Numbers.
Positional Number Systems
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.
Tasanawan Soonklang Department of Computing, Faculty of Science Data Representation.
Number Systems and Digital Codes
Data Representation, Number Systems and Base Conversions
Computer Math CPS120 Introduction to Computer Science Lecture 4.
SAK Chapter 21 Chapter 2 : Number System 2.1 Decimal, Binary, Octal and Hexadecimal Numbers 2.2 Relation between binary number system with other.
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Number Systems Denary Base 10 Binary Base 2 Hexadecimal Base 16
Agenda Character representation Numerical Conversions ASCII EBCDIC
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Monday, January 13 CEC 220 Digital Circuit Design Slide 1 of 14.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  The necessity and advantages of coding  The variety of coding systems You will learn: 2.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
CCE Department – Faculty of engineering - Islamic University of Lebanon Chapter 6 Binary Arithmetic.
©2010 Cengage Learning SLIDES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION Click the mouse to move to the next page. Use the ESC key to exit.
Computer Data Formats Microprocessor Course Electrical Engineering Department University of Indonesia.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
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.
Advanced Binary b. describe and use two’s complement and sign and magnitude to represent negative integers; c. perform integer binary arithmetic, that.
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.
Unit I From Fundamentals of Logic Design by Roth and Kinney.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Number Systems.
SYEN 3330 Digital Systems Chapter 1 SYEN 3330 Digital Systems.
BCD = Binary Coded Decimal
Data Representation – Chapter 3
Dr. Clincy Professor of CS
COMS 161 Introduction to Computing
C1 Number systems.
COMS 161 Introduction to Computing
ECE 331 – Digital System Design
Presentation transcript:

Binary Arithmetic & Data representation

Addition 0 + 0 = 0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 0 , with carry 1 1 + 1 + 1 = 1 , with carry 1 Example 1 0 0 1 1 1 + 1 1 0 1 1 10 0 0 0 1 0

Subtraction Example 1 0 1 0 1 - 1 1 1 0 0 0 1 1 1 0 - 0 = 0 1 - 0 = 1 1 - 1 = 0 0 - 1 = 1 , with borrow 1 [same as borrowing 1 from next column 10-1=1] Example 1 0 1 0 1 - 1 1 1 0 0 0 1 1 1

Multiplication Example 1 0 1 0 x 1 0 0 1 0 0 0 0 1 0 1 1 0 1 0

Division 0 / 1 = 0 1 / 1 = 1 Example 110 ) 100001 ( 0101 110 1000 100 1001 11

Subtraction by addition Computers store negative numbers in the form of their arithmetic complements. Computers’ use 2’s complement form. Example, binary form 11100011 1’s complement 00011100 2’s complement 00011101 We will use 2’s complement for subtraction. First convert the negative number into 2’s complement form. Then add it to the other number.

Example, 11110000 (B=11110000=240) + 01110010 (A=10001110=142) 1 01100010 (Result=98) Discard 10111 (B=01001=9) + 00100 (A=00100=4) 11011 (Result=-5) 2’s complement of 11011=00101=5

Numeric data representation An integer or fixed point number has no decimal point. An integer I is represented in the memory of the computer by its binary form if I is positive or by its 2’s complement if I is negative.

BCD code Another way to represent numerical data is to convert each decimal digit to its corresponding binary format. 4 bits are needed to code each decimal digit. Its called binary coded decimal (BCD). Example, 469 0100 0110 1001

Alphanumeric codes There are two 8-bit alphanumeric codes, ASCII (American Standard Code for Information Interchange) and EBCDIC (Extended Binary-Coded Decimal Interchange Code). ASCII codes have a zone part. The 16-bit Unicode is becoming popular. Unicode supports international languages.