CMP 101 Fundamentals of Computer and programming in C Rohit Khokher.

Slides:



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

Number Systems & Operations
Integer division Pencil and paper binary division (dividend)(divisor) 1000.
Princess Sumaya Univ. Computer Engineering Dept. Chapter 3:
Binary Addition Rules Adding Binary Numbers = = 1
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 )
Chapter Chapter Goals Know the different types of numbers Describe positional notation.
Decimal Addition What is going on? (carry) (subtract the base)
1 CSE-221 Digital Logic Design (DLD) Lecture-1: Digital Systems & Number Systems.
DIGITAL SYSTEMS TCE1111 Representation and Arithmetic Operations with Signed Numbers Week 6 and 7 (Lecture 1 of 2)
Computer ArchitectureFall 2007 © August 29, 2007 Karem Sakallah CS 447 – Computer Architecture.
FIGURES FOR CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Data Representation in Computers. Data Representation in Computers/Session 3 / 2 of 33 Number systems  The additive approach – Number earlier consisted.
Chapter 1 Whole Numbers; How to Dissect and Solve Problems McGraw-Hill/Irwin Copyright © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
1 Arithmetic and Logical Operations - Part II. Unsigned Numbers Addition in unsigned numbers is the same regardless of the base. Given a pair of bit sequences.
Data Representation – Binary Numbers
Conversion Between Lengths Positive number pack with leading zeros +18 = = Negative numbers pack with leading ones -18 =
Chapter 7 Arithmetic Operations and Circuits Binary Arithmetic Addition –When the sum exceeds 1, carry a 1 over to the next-more-significant column.
BINARY ARITHMETIC Binary arithmetic is essential in all digital computers and in many other types of digital systems.
Binary Arithmetic & Data representation
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Number Systems. Why binary numbers? Digital systems process information in binary form. That is using 0s and 1s (LOW and HIGH, 0v and 5v). Digital designer.
Integer Conversion Between Decimal and Binary Bases Conversion of decimal to binary more complicated Task accomplished by –Repeated division of decimal.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Chapter 2 Binary Values and Number Systems. 2 2 Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645,
– Digital Circuit 1 Choopan Rattanapoka
Positional Number Systems
Operations on Bits Arithmetic Operations Logic Operations
Number Systems Binary to Decimal Octal to Decimal Hexadecimal to Decimal Binary to Octal Binary to Hexadecimal Two’s Complement.
ABC/ Mathematics / Chapter 1 / TP / Rev 1 © 2003 General Physics Corporation OBJECTIVES 1.Without a calculator; ADD, SUBTRACT, MULTIPLY, and DIVIDE.
1 4. Computer Maths and Logic 4.1 Number Systems.
Introduction To Number Systems Binary System M. AL-Towaileb1.
Division. Just as multiplication can be expressed as a series of additions, division can be seen as a series of subtractions. 21 ÷ 7 asks how many times.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Logic Design Dr. Oliver Faust.
Unknown Numbers in Addition, Subtraction, Multiplication, Division LESSON 3POWER UP APAGE 20.
Integers’ Representation. Binary Addition. Two's Complement. Unsigned number representation Binary Addition, Subtraction. Overflow of unsigned numbers.
EEE342 Digital Electronics Ian McCrumRoom 5B18, Lecture 2: Codes & Arithmetic.
Addition Multiplication Subtraction Division. 1.If the signs are the same, add the numbers and keep the same sign = = If the.
©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.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
1 CS 151 : Digital Design Chapter 4: Arithmetic Functions and Circuits 4-3 : Binary Subtraction.
Estimation and Computation By: Your Name (First, Last) Section: O-
COMPUTER ARITHMETIC Arithmetic with Signed-2's Complement Numbers
Integer Operations Computer Organization and Assembly Language: Module 5.
Number Systems & Binary How to count. How do we represent numbers? Early systems: – Actual count : ||||| = 5 – Roman numers : XI = 11 Hard to do math:
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
= 91 sum operation augend addend NOTE: Sometimes both the augend and addend are called addends. Sometimes the sum is called the total. Addition.
Week 1(Number System) Muhammad Ammad uddin Logic Design Lab I (CEN211)
Intro to Math… Lesson 1. 4 Fundamental Operations Of Math Example: adding + subtracting - multiplying x dividing ÷
Prepared By: Norakmar Binti Mohd Nadzari CHAPTER 2 ARITHMETIC AND LOGIC UNIT.
COMPUTER ORGANIZATION 4 TH LECTURE. ASCII Code  ASCII ( American Standard Code for Information Interchange).  Input and output devices that communicate.
COMPUTER ARITHMETIC Arithmetic with Signed-2's Complement Numbers
Digital Systems and Number Systems
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Number System Submitted by: Submitted to: Devashish Bhardwaj Miss.Hina
Number Systems & Binary
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
King Fahd University of Petroleum and Minerals
COMPLEMENTS Complements are used in digital computers for simplifying the subtraction operations and for logical manipulation. There are two types of complements.
Computer Organization and Design
Computation in Other Bases
ECEG-3202 Computer Architecture and Organization
CPS120: Introduction to Computer Science
§4.3, Computation in Positional Systems
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
Introduction To Number Systems
COE 202: Digital Logic Design Number Systems Part 2
Presentation transcript:

CMP 101 Fundamentals of Computer and programming in C Rohit Khokher

Computer Arithmetic Every thing that can be done in decimal number system can also be done in binary number system Binary Arithmetic

Addition 0+0=0 0+1=1 1+0=1 1+1=0 A carry of 1 to the next higher column Like in Decimal System 9+1=0

Examples

Subtraction 0-0=0 0-1=1 1-0=1 1-1=0 A borrow from the left column

Subtraction

Complementary Subtraction Complement = (base n -1) –m Where: M is the number. n denotes number of digits in m Complement of = =99-37 = 62 10

Complementary Method Find complement of subtrahend Add the minuend If there is carry of 1, add it. If no carry, then re-complement the result and negate the number.

Complementary Method Subtract (subtrahend) from (minuend) = 1 35, 35+1 =36 Subtract (subtrahend) from (minuend) = = - 17 There is a carry so add it There is no carry so re- complement and negate the result

Complementary Method Subtract from Subtrahend Complement Minuend Carry ?Yes 1Add it Result

Complementary Method Subtract from Subtrahend Complement Minuend Carry ?No Re-complement Place a Negative Sign

Multiplications 0×00 0×10 1×00 1× × Multiplicand Multiplier 1010 × SS For each 0 shift left

Multiplications 1111 x Carry

Division DividendDivisor Quotient Remainder Subtraction not possible quotient 0 Subtraction possible quotient Result