DIGITAL Logic DESIGN Digital system and binary numbers Lecturer: Ms. Farwah Ahmad.

Slides:



Advertisements
Similar presentations
Addition and Subtraction. Outline Arithmetic Operations (Section 1.2) – Addition – Subtraction – Multiplication Complements (Section 1.5) – 1’s complement.
Advertisements

COE 202: Digital Logic Design Signed Numbers
Chapter 1 Digital Systems and Numbers System
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 1 Negative Number (Sign & Magnitude) Negative number always written with sign at the front: –Example: -(20)
CS 151 Digital Systems Design Lecture 3 More Number Systems.
Agenda Shortcuts converting among numbering systems –Binary to Hex / Hex to Binary –Binary to Octal / Octal to Binary Signed and unsigned binary numbers.
CSCI 232© 2005 JW Ryder1 Bases  = (3 * 10 2 ) + (2 * 10 1 ) + (4 * 10 0 )  = (3 * 8 2 ) + (2 * 8 1 ) + (4 * 8 0 )  = (1 * 2 3 )
ECE 331 – Digital System Design
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
CS1104-2aNumber Systems Supplementary Notes 1 Lecture 2: Number Systems Supplementary Notes  Complements Complements  Floating-point Numbers Floating-point.
Binary Addition Addition Rules: = = = = = carry 1 1 carry 1 Example 1: Example 2:
Binary numbers and arithmetic. ADDITION Addition (decimal)
Digital Systems and Binary Numbers
Computer Arithmetic.
Dale & Lewis Chapter 3 Data Representation. Data and computers Everything inside a computer is stored as patterns of 0s and 1s Numbers, text, audio, video,
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Complement Numbers. Outline  Negative Numbers Representation  Sign-and-magnitude  1s Complement  2s Complement  Comparison of Sign-and-Magnitude.
Number Representation. 10/12/2015CDA31002 Conversion between Representations Now we can represent a quantity in different number representations How can.
Number systems & Binary codes MODULE 1 Digital Logic Design Ch1-2 Outline of Chapter 1  1.1 Digital Systems  1.2 Binary Numbers  1.3 Number-base Conversions.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
IT101: INFORMATION TECHNOLOGY FUNDAMENTALS 1 Edited By Dr. Ahmed Abo-Bakr Information Technology Dept. Faculty of Computers & Information.
Computer Arithmetic and the Arithmetic Unit Lesson 2 - Ioan Despi.
Dr. Ahmed Telba EE208: Logic Design Lecture# 1 Introduction & Number Systems.
1 Dr. Mohamed Abdur Rahman Office hours Sunday: 10:00- 12:00 & Tuesday: 3:00 - 3:50 Course website: Has been created
Chapter 3 Complements Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Digital Logic Lecture 3 Binary Arithmetic By Zyad Dwekat The Hashemite University Computer Engineering Department.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
1 4. Computer Maths and Logic 4.1 Number Systems.
Module 2.  In Module 1, we have learned basic number representation which include binary, octal, hexadecimal and decimal.  In digital systems, numbers.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Assoc. Prof. Dr. Ahmet Turan ÖZCERİT.  The base of numbers  Conversion between number bases  Arithmetic operations on different bases You will learn:
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
ECE 171 Digital Circuits Chapter 2 Binary Arithmetic Herbert G. Mayer, PSU Status 1/14/2016 Copied with Permission from prof. Mark PSU ECE.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
In decimal we are quite familiar with placing a “-” sign in front of a number to denote that it is negative The same is true for binary numbers a computer.
1 CS 151 : Digital Design Chapter 4: Arithmetic Functions and Circuits 4-3 : Binary Subtraction.
Computer Engineering page 1 Integer arithmetic Depends what you mean by “integer”. Assume at 3-bit string. –Then we define: zero = 000 one = 001 Use zero,
Binary Addition The simplest arithmetic operation in binary is addition. Adding two single-digit binary numbers is relatively simple, using a form of carrying:
Week 1(Number System) Muhammad Ammad uddin Logic Design Lab I (CEN211)
Negative Number Sign-Magnitude: left-most bit as the sign bit –16 bits –Example: 4-bit numbers is given by is given by ’s complement:
CPE 201 Digital Design Lecture 3: Digital Systems & Binary Numbers (3)
Chapter 1 Digital Systems and Binary Numbers
Digital Logic & Design Adil Waheed Lecture 02.
Negative Binary Numbers
Digital Logic & Design Dr. Waseem Ikram Lecture 02.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
COMPUTING FUNDAMENTALS
Lecture 2 Topics Binary Arithmetic (Unsigned binary operands)
Negative Binary Numbers
Addition and Substraction
Dr. Clincy Professor of CS
Binary Addition & Subtraction
Complement Theory 1’s and, 2’s complement operation
Number Representation
Complement Theory 1’s and, 2’s complement operation
Data Representation in Computer Systems
Digital Logic & Design Lecture 02.
Digital Logic Design (ECEg3141) 2. Number systems, operations & codes 1.
Two’s Complement Shortcut
Unit 18: Computational Thinking
CPS120: Introduction to Computer Science
Binary to Decimal Conversion
ECE 171 Digital Circuits Chapter 2 Binary Arithmetic
CSC 220: Computer Organization Signed Number Representation
Integer arithmetic Depends what you mean by "integer"
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
Subtracting integers without number line 3 digit.
Dr. Clincy Professor of CS
Adding integers without number line 2 digit.
Presentation transcript:

DIGITAL Logic DESIGN Digital system and binary numbers Lecturer: Ms. Farwah Ahmad

Observation:  Subtraction from (r n – 1) will never require a borrow  Diminished radix complement can be computed digit-by-digit

Complements 2’s Complement (Radix Complement)  Take 1’s complement then add 1  Toggle all bits to the left of the first ‘1’ from the right Example: Number: 1’s Comp.:

Complements 1’s Complement (Diminished Radix Complement)  All ‘0’s become ‘1’s  All ‘1’s become ‘0’s Example ( ) 2  ( ) 2 If you add a number and its 1’s complement …

Shortcuts 1. Diminished radix complement can be computed digit-by-digit, Just complement the bits. 2. If add 1 in diminished radix complement it becomes radix complement. 3. Write down the given number. 1. Starting from LSB,copy all the zero till the first 1 (for the case of binary) 2. Copy the first Complement remaining bits.

Complements Subtraction with Complements The subtraction of two n-digit unsigned numbers M – N in base r can be done as follows:

Complements Example 1.5 Using 10's complement, subtract – Example 1.6 Using 10's complement, subtract 3250 – There is no end carry. Therefore, the answer is – (10's complement of 30718) = 

Complements Example 1.7 Given the two binary numbers X = and Y = , perform the subtraction (a) X – Y ; and (b) Y  X, by using 2's complement. There is no end carry. Therefore, the answer is Y – X =  (2's complement of ) = 

Complements Subtraction of unsigned numbers can also be done by means of the (r  1)'s complement. Remember that the (r  1) 's complement is one less then the r's complement. Example 1.8 Repeat Example 1.7, but this time using 1's complement. There is no end carry, Therefore, the answer is Y – X =  (1's complement of ) = 

Binary Subtraction using 1’s complement Convert number to be subtracted to it’s 1’s complement form Perform the addition If the final carry is 1, then add it to the result obtained in step 2. If the final carry is zero, result obtained in step 2 is negative and in the 1’s complement form.

Binary Subtraction using 2’s complement Convert number to be subtracted to it’s 2’s complement form Perform the addition If the final carry is generated, then the result is positive and in true form. If the final carry is zero, result obtained is negative and in 2’s complement form.

Do solve exercise problem no 1.17,1.18 Practice Questions