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

Slides:



Advertisements
Similar presentations
Appendix 1 Number Systems Objectives: Review of number systems and radix conversion methods Review of binary, octal, hexadecimal and BCD unsigned codes.
Advertisements

EMB1006 The Binary System There is no 2 Jonathan-Lee Jones.
CSE115: Introduction to Computer Science I Dr. Carl Alphonce 219 Bell Hall 1.
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.
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
Major Numeric Data Types Unsigned Integers Signed Integers Alphanumeric Data – ASCII & UNICODE Floating Point Numbers.
1 Binary Arithmetic, Subtraction The rules for binary arithmetic are: = 0, carry = = 1, carry = = 1, carry = = 0, carry =
Bit Operations C is well suited to system programming because it contains operators that can manipulate data at the bit level –Example: The Internet requires.
Number System and Codes
1 Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to bits.
Floating Point Numbers.  Floating point numbers are real numbers.  In Java, this just means any numbers that aren’t integers (whole numbers)  For example…
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Number Systems Computer Science 210 Computer Organization.
Binary Number Systems.
Binary Representation and Computer Arithmetic
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
The Binary Number System
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Computer Organization & Programming Chapter2 Number Representation and Logic Operations.
© Janice Regan, CMPT 128, Jan CMPT 128: Introduction to Computing Science for Engineering Students Integer Data representation Addition and Multiplication.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Binary Representation. Binary Representation for Numbers Assume 4-bit numbers 5 as an integer  as an integer  How? 5.0 as a real number  How?
Computing Higher - Unit 1… Computer Systems 1 Higher Computing Unit 1 – Topic 1 Data Representation.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Click to edit Master title style Click to edit Master text styles –Second level Third level –Fourth level »Fifth level 1 Today’s Topics How information.
2-1 Chapter 2 - Data Representation Principles of Computer Architecture by M. Murdocca and V. Heuring © 1999 M. Murdocca and V. Heuring Chapter Contents.
Computer Science 111 Fundamentals of Programming I Number Systems.
IT253: Computer Organization
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
1 COMS 161 Introduction to Computing Title: Numeric Processing Date: October 20, 2004 Lecture Number: 23.
Number Systems. Today Decimal Hexadecimal Binary –Unsigned Binary –1’s Complement Binary –2’s Complement Binary.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Chapter 2: The Logic of Compound Statements 2.5 Application: Number Systems and Circuits for Addition 1 Counting in binary is just like counting in decimal.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
BR 8/99 Binary Numbers Again Recall than N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to 255.
The Hexadecimal Number System and Memory Addressing ISAT 121.
COMP201 Computer Systems Floating Point Numbers. Floating Point Numbers  Representations considered so far have a limited range dependent on the number.
EEL 3801C EEL 3801 Part I Computing Basics. EEL 3801C Data Representation Digital computers are binary in nature. They operate only on 0’s and 1’s. Everything.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
THE BINARY NUMBER SYSTEM “There are only 10 types of people in this world: Those who understand BINARY and those who do not.”
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Bits, Data types, and Operations: Chapter 2 COMP 2610 Dr. James Money COMP
Chapter 1: Binary Systems
Binary 101 Gads Hill School. Aim To strengthen understanding of how computers use the binary number system to store information.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
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.
Software Design and Development Storing Data Computing Science.
Arithmetic Circuits I. 2 Iterative Combinational Circuits Like a hierachy, except functional blocks per bit.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
Floating Point Numbers
Topic: Binary Encoding – Part 2
Cosc 2150: Computer Organization
Topic: Binary Encoding – Part 1
Bits, Data Types, and Operations
ECE 2110: Introduction to Digital Systems
Integer Real Numbers Character Boolean Memory Address CPU Data Types
EPSII 59:006 Spring 2004.
Number Systems.
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Decimal System The radix or base of a number system determines
1.6) Storing Integer:.
Storing Negative Integers
Unsigned Binary Encoding
靜夜思 床前明月光, 疑是地上霜。 舉頭望明月, 低頭思故鄉。 ~ 李白 李商隱.
Networks & I/O Devices.
Presentation transcript:

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

The Bit as the Unit of Information At the underlying level, we let the electrons and the volts be a value, either on or off This is cheaper and simplier than have a circuit who can detect volts versus 120 volts We let 1 represent the presence of voltage and 0 as the absence of voltage

The Bit as the Unit of Information We refer to each 1 or 0 as a bit, which is the short form of binary digit For the decimal system, there are 10: 0,1,2,3,4,5,6,7,8,9 For the binary system, there are two values 0 and 1

The Bit as the Unit of Information More precisely, we only detect voltage from 0 and far from zero So, if we had a range of 0 to 2.9 volts, 2.6 might be 1, and 0.2 might be regarded as 0

The Bit as the Unit of Information In order to represent larger quantities, we use a combination of bits Many times, we combine 8 bits for one particular value That gives us 2 8 =256 different values In general, k bits allows for 2 k different values

Data Types We can represent values in a number of different ways For example, we can represent 5 by holding 5 fingers up In binary, this might be written as This notation is called unary

Data Types The Romans had their own value as well: V There is a final representation that we will use: We use this form since we have to manipulate the values in addition to representing them

Data Types We say a representation is a data type if there are operations in the computer that can manipulate this representation There are two basic data types: – ASCII code – used for characters on the keyboard – 2's complement integers – used for positive and negative integers

Data Types There are other data types For example, there is scientific notation: 3.4 x10 -4 The data type on the computer for this is called floating point

Unsigned Integers We first consider the unsigned integers as a data type We use this for counting and memory addresses We use a positional notation for the binary representation

Unsigned Integers To understand positional notation in general, consider the decimal number 583 We know that 5 stands for 500, 8 for 80 and 3 for 3 That is, – 583 = 5* *10 + 3*1

Unsigned Integers Or, in scientific form, – 583=5x x x10 0 Now, the binary form works the same, so the number 6 is – 6 = = 0x x x x2 1 +0x2 0 For k bits, we can represent 0..2 k -1

Unsigned Addition Let's add 6+3: (6) 10 = (0110) 2 (3) 10 =(0011) =( 9) 10