CCE Department – Faculty of engineering - Islamic University of Lebanon Chapter 6 Binary Arithmetic.

Slides:



Advertisements
Similar presentations
ICS312 Set 2 Representation of Numbers and Characters.
Advertisements

HEXADECIMAL NUMBERS Code
Company LOGO Edit your slogan here DKT 122/3 DIGITAL SYSTEM 1 WEEK #3 NUMBER SYSTEMS, OPERATION & CODES (PART 2)
ENGIN112 L4: Number Codes and Registers ENGIN 112 Intro to Electrical and Computer Engineering Lecture 4 Number Codes and Registers.
Number Systems Discussion D4.1 Appendix C. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
CHAPTER 2 Number Systems, Operations, and Codes
ECE 331 – Digital System Design
Digital Fundamentals Floyd Chapter 2 Tenth Edition
CS 151 Digital Systems Design Lecture 3 More Number Systems.
CS 151 Digital Systems Design Lecture 4 Number Codes and Registers.
Review Two’s complement
EECC341 - Shaaban #1 Lec # 3 Winter Binary Multiplication Multiplication is achieved by adding a list of shifted multiplicands according.
Negative Numbers Module M3.3 Section 2.4. Negative Numbers Subtract by adding ’s complement Ignore carry.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
Mathematics with Binary. Question  Below is a binary string  Which is the least significant bit (LSB)?  Which is the most significant bit (MSB)? 0.
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
Number Systems and Codes Discussion D4.1. Number Systems Counting in Binary Positional Notation Hexadecimal Numbers Negative Numbers.
Information Representation and Number Systems BIL- 223 Logic Circuit Design Ege University Department of Computer Engineering.
Data Storage. SIGN AND MAGNITUDE Storing and representing numbers.
1.6 Signed Binary Numbers.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Number Systems and Codes
Binary Addition Addition Rules: = = = = = carry 1 1 carry 1 Example 1: Example 2:
Arithmetic for Computers
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
EKT 121 / 4 ELEKTRONIK DIGIT 1 CHAPTER 1 : INTRODUCTION.
BINARY ARITHMETIC Binary arithmetic is essential in all digital computers and in many other types of digital systems.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Chapter 3 Data Representation
Binary Arithmetic & Data representation
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Topic 2 – Introduction to Computer Codes. Computer Codes A code is a systematic use of a given set of symbols for representing information. As an example,
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Number Systems Spring Semester 2013Programming and Data Structure1.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
ICS312 Set 1 Representation of Numbers and Characters.
CS151 Introduction to Digital Design
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
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.
ECE 2110: Introduction to Digital Systems Signed Addition/Subtraction.
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
THE BINARY SYSTEM.
ECE 331 – Digital System Design Representation and Binary Arithmetic of Negative Numbers and Binary Codes (Lecture #10) The slides included herein were.
AEEE2031 Data Representation and Numbering Systems.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
ECE 301 – Digital Electronics Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included.
Introduction to Microprocessors Chapter 2. Decimal or Base 10 Numbers  Have ten different digits (0-9)  It is a weighted number system. Each position.
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.
CEC 220 Digital Circuit Design Binary Arithmetic & Negative Numbers Fri, Aug 28 CEC 220 Digital Circuit Design Slide 1 of 14.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 4 Dr. Shi Dept. of Electrical and Computer Engineering.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
ECE DIGITAL LOGIC LECTURE 4: BINARY CODES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/26/2016.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
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.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
CHAPTER 1 : INTRODUCTION
Binary Arithmetic Binary arithmetic is essential in all digital computers and in many other types of digital systems. Addition, Subtraction, Multiplication,
Chapter 3 Data Representation
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
COMS 161 Introduction to Computing
ECE 331 – Digital System Design
Presentation transcript:

CCE Department – Faculty of engineering - Islamic University of Lebanon Chapter 6 Binary Arithmetic

CCE Department – Faculty of engineering - Islamic University of Lebanon Addition 1

CCE Department – Faculty of engineering - Islamic University of Lebanon Binary Addition Binary addition is very simple. This is best shown in an example of adding two binary numbers… carries

CCE Department – Faculty of engineering - Islamic University of Lebanon Binary addition example worked out Some terms are given here Exercise: what are these numbers equivalent to in decimal? (Carries) 1011(Augend) +1110(Addend) 11001(Sum) The initial carry in is implicitly 0 most significant bit (MSB) least significant bit (LSB)

CCE Department – Faculty of engineering - Islamic University of Lebanon Subtraction 4

CCE Department – Faculty of engineering - Islamic University of Lebanon Binary Subtraction 5 °We can also perform subtraction (with borrows in place of carries). °Let’s subtract (10111) 2 from ( ) 2 … borrows

CCE Department – Faculty of engineering - Islamic University of Lebanon Negative Numbers 6 Subtract by adding ’s complement Ignore carry

CCE Department – Faculty of engineering - Islamic University of Lebanon Two’s Complement Shortcuts Algorithm – Simply complement each bit and then add 1 to the result. –Finding the 2’s complement of ( ) 2 and of its 2’s complement… N = [N] =

CCE Department – Faculty of engineering - Islamic University of Lebanon Negative Numbers 8 Subtract by adding ’s comp flip

CCE Department – Faculty of engineering - Islamic University of Lebanon 9

Signed Numbers 10 4-bit: 8H = -8 to 7H = to bit: 80H = -128 to 7F = bit: 8000H = -32,768 to 7FFFH = +32, bit: H = -2,147,483,648 to 7FFFFFFFH = +2,147,483,647

CCE Department – Faculty of engineering - Islamic University of Lebanon Questions 11 What is the two’s complement of ? What hex number represents the decimal number -40?

CCE Department – Faculty of engineering - Islamic University of Lebanon Multiplication 12

CCE Department – Faculty of engineering - Islamic University of Lebanon Binary Multiplication Binary multiplication is much the same as decimal multiplication, except that the multiplication operations are much simpler… X

CCE Department – Faculty of engineering - Islamic University of Lebanon ASCII CODES 14

CCE Department – Faculty of engineering - Islamic University of Lebanon ASCII The most commonly used code for representing letters, numerals and punctuation characters (alphanumeric data) Each character is represented with a 7-bit string; for example: ‘3’ = (hex 33) ‘ ’ = (hex 20) An 8-bit extension of ASCII has also been defined 15

CCE Department – Faculty of engineering - Islamic University of Lebanon ASCII Code American Standard Code for Information Interchange ASCII is a 7-bit code, frequently used with an 8 th bit for error detection (more about that in a bit). 16 CharacterASCII (bin) ASCII (hex) Decimal A B C … Z a … 1 ‘

CCE Department – Faculty of engineering - Islamic University of Lebanon ASCII Properties 17 Q1: What is relationship between a decimal digit (0, 1, …) and its ASCII code?

CCE Department – Faculty of engineering - Islamic University of Lebanon ASCII Properties (2) 18 Q2: What is the difference between an upper-case letter (A, B, …) and its lower-case equivalent (a, b, …)?

CCE Department – Faculty of engineering - Islamic University of Lebanon BCD 19

CCE Department – Faculty of engineering - Islamic University of Lebanon Binary Coded Decimal Binary coded decimal (BCD) represents each decimal digit with four bits –Ex = 329 BCD This is NOT the same as Why do this? Because people think in decimal. 20 DigitBCD CodeDigitBCD Code

CCE Department – Faculty of engineering - Islamic University of Lebanon Putting It All Together 21 °BCD not very efficient °Used in early computers (40s, 50s) °Used to encode numbers for seven- segment displays. °Easier to read?