Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP 2610 1.

Slides:



Advertisements
Similar presentations
2-1 Chapter 2 - Data Representation Computer Architecture and Organization by M. Murdocca and V. Heuring © 2007 M. Murdocca and V. Heuring Computer Architecture.
Advertisements

Chapter 2: Data Representation
Principles of Computer Architecture Miles Murdocca and Vincent Heuring Chapter 2: Data Representation.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
Chapter 5 Floating Point Numbers. Real Numbers l Floating point representation is used whenever the number to be represented is outside the range of integer.
Chapter 3 Data Representation.
Chapter 3 Data Representation. Chapter goals Describe numbering systems and their use in data representation Compare and contrast various data representation.
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
Introduction to Computing Systems (1st Exam). 1. [10] What is the range of decimal integers that can be represented by the following given numbers of.
Representing Real Numbers Using Floating Point Notation Lecture 6 CSCI 1405, CSCI 1301 Introduction to Computer Science Fall 2009.
Chapter 2 Data Types, Declarations, and Displays
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
S. Barua – CPSC 240 CHAPTER 2 BITS, DATA TYPES, & OPERATIONS Topics to be covered are Number systems.
Data Representation 3 This week – Recap on Floating point number – ASCII – unicode.
© BYU 02 NUMBERS Page 1 ECEn 224 Binary Number Systems and Codes.
Chapter 5 Data representation.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Simple Data Type Representation and conversion of numbers
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Binary Numbers. Why Binary? Maximal distinction among values  minimal corruption from noise Imagine taking the same physical attribute of a circuit,
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
1 Digital Technology and Computer Fundamentals Chapter 1 Data Representation and Numbering Systems.
Computer Math CPS120: Data Representation. Representing Data The computer knows the type of data stored in a particular location from the context in which.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Principles of Computer.
COMPSCI 210 Semester Tutorial 1
Data Representation - Part II. Characters A variable may not be a non-numerical type Character is the most common non- numerical type in a programming.
Floating Point. Agenda  History  Basic Terms  General representation of floating point  Constructing a simple floating point representation  Floating.
Data Representation Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
Chapter 2 Bits, Data Types, and Operations. 2-2 Hexadecimal Notation It is often convenient to write binary (base-2) numbers as hexadecimal (base-16)
1 Lecture 2  Complement  Floating Point Number  Character Encoding.
CISC1100: Binary Numbers Fall 2014, Dr. Zhang 1. Numeral System 2  A way for expressing numbers, using symbols in a consistent manner.  " 11 " can be.
1 Data Representation Characters, Integers and Real Numbers Binary Number System Octal Number System Hexadecimal Number System Powered by DeSiaMore.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Signed Integers The highest bit indicates the sign. 1 = negative, 0 = positive.
CEC 220 Digital Circuit Design Binary Codes
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Data Representation: Floating Point for Real Numbers Computer Organization and Assembly Language: Module 11.
Chapter 1: Binary Systems
NUMBER SYSTEMS AND CODES. CS Digital LogicNumber Systems and Codes2 Outline Number systems –Number notations –Arithmetic –Base conversions –Signed.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
 Computers are 2-state devices › Pulse – No pulse › On – Off  Represented by › 1 – 0  BINARY.
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.
Computer Representation of Information
Compsci 210 Tutorial Two CompSci Semester Two 2016.
Bits, Data Types, and Operations
Chapter 2 Bits, Data Types, and Operations
Programming and Data Structure
NUMBER SYSTEMS.
Number Representation
Computer Architecture & Operations I
Data Representation Binary Numbers Binary Addition
Data Transfer ASCII FILES.
ECE 103 Engineering Programming Chapter 3 Numbers
Why use Binary? There are only four rules for addition in binary compared to 100 in decimal [0+0=0 ; 0+1=1 ; 1+0=1; 1+1=10]
Chapter 2 Bits, Data Types & Operations Integer Representation
CSCI206 - Computer Organization & Programming
Number Representations
Data Representation Data Types Complements Fixed Point Representation
Storing Negative Integers
Storing Integers and Fractions
Networks & I/O Devices.
Chapter 3 - Binary Numbering System
Number Representations
Presentation transcript:

Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP

Floating Point Data Type Most ISAs have a data type called float, which is 32 bits arranged as follows – 1 bit for sign – 8 bits for range of exponent – 23 bits for the precision or fraction This is called the IEEE Standard for Floating Point Arithmetic

Floating Point Data Type

Recall the bits in the fractional part are of the form 1.b -1 b -2 …b -j The corresponding decimal number is 1x2 0 + b -1 x2 -1 +b -2 x2 -2 +… + b -j 2 -j

Floating Point Data Type If the exponent= , then we can represent tiny numbers. In this case, we assume the leading digit is zero and not 1 and exp=-126. That is, it is of the form -1 s 0.fraction x

Floating Point Data Type Consider the floating point value This is x =

Floating Point Data Type Interpret the floating point values – – –

ASCII Codes Another standard of representation is one for transferring character codes This is an eight bit code referred to ASCII ASCII stands for American Standard Code for Information Exchange It simplifies the interface between I/O devices among companies

ASCII Codes Each key on a keyboard is identified by a unique ASCII code The digit 3 is ( ) 2 = (41) 10, digit 3 is ( ) 2 = (40) 10 The letter ‘e’ is ( ) 2 and carriage return is ( ) 2

ASCII Codes The list of codes are at the back of the book for all 256 ASCII codes Some codes are associate with multiple keys, such as ‘e’ and ‘E’

Hexadecimal Notation One form that is common for reading values on the computer is called hexadecimal notation Hexadecimal notation is the base 16 representation of the number

Hexadecimal Notation We use 0-9 for the same numbers in hexadecimal What about 10-15? We use the letters A-F

Hexadecimal Notation A – 10 B – 11 C – 12 D – 13 E – 14 F - 15

Hexadecimal Notation Consider the binary string This can be broken into groups of 4 bits: Now, recall that the range of 4 bits is 0 -15, just like hexadecimal notation

Hexadecimal Notation Hence, the numbers represent We typically prefix this by x or 0x to indicate hexadecimal form So our binary number is 0x3D6E D6E

Hexadecimal Notation What is the number 0x5A6C in binary form? Thus, (5A6C) 16 = ( ) 2 5A6C