Dr. Clincy Professor of CS

Slides:



Advertisements
Similar presentations
Representing Data, Pictures, Time, and Size in Computer
Advertisements

1 CSE1301 Computer Programming Lecture 29: Number Representation (Part 1)
CSC /703 CTI/DePaul1 CSC-255 Lecture 3 Text and Numerical Storage (Chapter 1 from Brookshear) Modified by Ufuk Verun from Jim Janossy © 2002, DePaul.
1 CSE1301 Computer Programming Lecture 28 Number Representation (Integer)
1 Lecture 4: Arithmetic for Computers (Part 4) CS 447 Jason Bakos.
Data Storage. SIGN AND MAGNITUDE Storing and representing numbers.
COMPUTER FUNDAMENTALS David Samuel Bhatti
Lecture 6 Topics Character codes Error Detection and Correction
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.
Bits & Bytes: How Computers Represent Data
Chapter 4: Representation of data in computer systems: Characters OCR Computing for GCSE © Hodder Education 2011.
Binary Arithmetic & Data representation
Cosc 2150: Computer Organization
NUMBER SYSTEM AND COMPUTER CODES Chapter 2. Prelude Fingers, sticks, and other things for counting were not enough! Counting large numbers Count in groups.
Number Systems Spring Semester 2013Programming and Data Structure1.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Data Representation, Number Systems and Base Conversions
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
Agenda Character representation Numerical Conversions ASCII EBCDIC
CSE1301 Computer Programming Lecture 32: Number Representation
DATA REPRESENTATION 4 Y. Colette Lemard February 2009.
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 =
CHAPTER 3 BINARY NUMBER SYSTEM. Computers are electronic machines which operate using binary logic. These devices use two different values to represent.
THE CODING SYSTEM FOR REPRESENTING DATA IN COMPUTER.
Numerical Representation Intro to Computer Science CS1510 Dr. Sarah Diesburg 1.
Introduction to computer science Lec2 cs111. Extended Binary Coded Decimal Interchange Code (EBCDIC) is an 8- bit character encoding used mainly on.
There are 10 different types of people in the world. Those who understand binary and those that don’t.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
Unit I From Fundamentals of Logic Design by Roth and Kinney.
1 Chapter 1: Basic Concepts Assembly Language for Intel-Based Computers, 4th edition Kip R. Irvine 9/6/2003.
Department of Computer Science Georgia State University
Programming and Data Structure
Arithmetic Shifts and Character Representation
Binary 1 Basic conversions.
Dr. Clincy Professor of CS
Digital Logic and Computer Organization
Dr. Clincy Professor of CS
CSCI 198: Lecture 4: Data Representation
Integer Real Numbers Character Boolean Memory Address CPU Data Types
Numerical Representation
CHAPTER 1 : INTRODUCTION
Dr. Clincy Professor of CS
CSCI 161: Lecture 4: Data Representation
Number Systems.
Data Encoding Characters.
TOPICS Information Representation Characters and Images
CS1010 Programming Methodology
Numerical Representation
Dr. Clincy Professor of CS
Ch2: Data Representation
Computer Data Types Basics of Computing.
Dr. Clincy Professor of CS
Computer Organization and Design
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
Data Representation – Chapter 3
COMS 161 Introduction to Computing
C1 Number systems.
COMS 161 Introduction to Computing
How Computers Store Data
Numerical Representation
2’s Complement form 1’s complement form 2’s complement form
Chapter 6: Computer Arithmetic
GCSE COMPUTER SCIENCE Topic 3 - Data 3.3 Logical and Arithmetic Shifts.
Dr. Clincy Professor of CS
Numerical Representation
Presentation transcript:

Dr. Clincy Professor of CS CS 3501 - Chapter 2 Dr. Clincy Professor of CS Dr. Clincy Lecture 4

Multiplication in base 2 – dealing with negative numbers By hand – signed case – best to use 2’s complement If both numbers are negative, perform as if both numbers are positive If one is negative and one number is positive, see below – extend out left-most bit Dr. Clincy Dr. Clincy Lecture 4 Lecture 2

How does the computer multiply integers (shifting) ? Computer doesn’t actually multiply – it adds and shifts Dr. Clincy Dr. Clincy Lecture 4 Lecture 3

Examples of Integer Multiplication by 2 Dr. Clincy Dr. Clincy Lecture 4 4 4

Another Example of Integer Multiplication by 2 Dr. Clincy Dr. Clincy Lecture 4 5 5

Examples of Integer Division by 2 Dr. Clincy Dr. Clincy Lecture 4 6 6

Booth’s Algorithm – Faster 2’s Complement Multiplication Dr. Clincy Dr. Clincy Lecture 4 7

Booth’s Algorithm Concept Dr. Clincy Dr. Clincy Lecture 4 8

Booth’s Algorithm Concept Dr. Clincy Dr. Clincy Lecture 4 9

Booth’s Algorithm Standard Approach Booth’s Algorithm Approach This is where 2’s complement comes into play Dr. Clincy Dr. Clincy Lecture 4 10

Booth’s Algorithm Only consider the first 16 bits – ignore beyond the 16th bit Dr. Clincy Dr. Clincy Lecture 4 11

Character Codes Calculations aren’t useful until their results can be displayed in a manner that is meaningful to people. We also need to store the results of calculations, and provide a means for data input. Thus, human-understandable characters must be converted to computer-understandable bit patterns using some sort of character encoding scheme. Dr. Clincy Lecture 4

Character Codes Binary-coded decimal (BCD) was one of these early codes. It was used by IBM mainframes in the 1950s and 1960s. In 1964, BCD was extended to an 8-bit code, Extended Binary-Coded Decimal Interchange Code (EBCDIC). Until recently, ASCII was the dominant character code outside the IBM mainframe world. Many of today’s systems embrace Unicode, a 16-bit system that can encode the characters of every language in the world Dr. Clincy Lecture 4

ASCII Dr. Clincy Lecture 4

EBCDIC Dr. Clincy Lecture 4

Character Codes Calculations aren’t useful until their results can be displayed in a manner that is meaningful to people. We also need to store the results of calculations, and provide a means for data input. Thus, human-understandable characters must be converted to computer-understandable bit patterns using some sort of character encoding scheme. Dr. Clincy Lecture 4

Character Codes Binary-coded decimal (BCD) was one of these early codes. It was used by IBM mainframes in the 1950s and 1960s. In 1964, BCD was extended to an 8-bit code, Extended Binary-Coded Decimal Interchange Code (EBCDIC). Until recently, ASCII was the dominant character code outside the IBM mainframe world. Many of today’s systems embrace Unicode, a 16-bit system that can encode the characters of every language in the world Dr. Clincy Lecture 4