Computer Organization

Slides:



Advertisements
Similar presentations
J. Michael Moore Computer Organization CSCE 110. J. Michael Moore High Level View Of A Computer ProcessorInputOutput Memory Storage.
Advertisements

Assembly Language and Computer Architecture Using C++ and Java
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Assembly Language and Computer Architecture Using C++ and Java
J. Michael Moore Computer Organization CPSC 110. J. Michael Moore High Level View Of A Computer ProcessorInputOutput Memory Storage.
2-1 Computer Organization Part Fixed Point Numbers Using only two digits of precision for signed base 10 numbers, the range (interval between lowest.
Simple Data Type Representation and conversion of numbers
Number Systems Part 2 Numerical Overflow Right and Left Shifts Storage Methods Subtraction Ranges.
NUMBER REPRESENTATION CHAPTER 3 – part 3. ONE’S COMPLEMENT REPRESENTATION CHAPTER 3 – part 3.
Chapter 1 Data Storage(3) Yonsei University 1 st Semester, 2015 Sanghyun Park.
IT253: Computer Organization
Data Representation and Computer Arithmetic
The Teacher CP4 Binary and all that… CP4 Revision.
Round-off Errors and Computer Arithmetic. The arithmetic performed by a calculator or computer is different from the arithmetic in algebra and calculus.
Lecture 2 Binary Values and Number Systems. The number 943 is an example of a number written in positional notation. The relative positions of the digits.
Monday, January 14 Homework #1 is posted on the website Homework #1 is posted on the website Due before class, Jan. 16 Due before class, Jan. 16.
CS1Q Computer Systems Lecture 2 Simon Gay. Lecture 2CS1Q Computer Systems - Simon Gay2 Binary Numbers We’ll look at some details of the representation.
Floating Point Binary A2 Computing OCR Module 2509.
CS 160 Lecture 4 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
Georgia Institute of Technology Introduction to Programming Part 3 Barb Ericson Georgia Institute of Technology May 2006.
©Brooks/Cole, 2003 Chapter 3 Number Representation.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
CS 125 Lecture 3 Martin van Bommel. Overflow In 16-bit two’s complement, what happens if we add =
Software Design and Development Storing Data Computing Science.
Module 2.2 Errors 03/08/2011. Sources of errors Data errors Modeling Implementation errors Absolute and relative errors Round off errors Overflow and.
Chapter 9 Computer Arithmetic
Floating Point Numbers
Nat 4/5 Computing Science Lesson 1: Binary
Floating Point Representations
Department of Computer Science Georgia State University
Objectives Today: P4 Data Types – Floating Points P4 Variable Quiz P3 Iteration and Selection Practical Are you logged on? Then come around the table Unit.
Binary & Hex Review.
David Kauchak CS 52 – Spring 2017
Number Representation
CSCI 198: Lecture 4: Data Representation
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
Chapter 3 Data Storage.
Numbers in a Computer Unsigned integers Signed magnitude
CSCI 161: Lecture 4: Data Representation
Data Representation Integers
EPSII 59:006 Spring 2004.
CSE 102 Introduction to Computer Engineering
A Level Computing Component 2
William Stallings Computer Organization and Architecture 7th Edition
Data Structures Mohammed Thajeel To the second year students
Binary Numbers Material on Data Representation can be found in Chapter 2 of Computer Architecture (Nicholas Carter) CSC 370 (Blum)
Number Representations
CSCE Fall 2013 Prof. Jennifer L. Welch.
Data Representation Bits
Fundamentals of Programming I Number Systems
Arithmetic Logical Unit
Data Representation Limitations
Number Representation
Binary “There are 10 types of people in the world: Those who understand binary, and those who don't.”
How Computers Store Data
Chapter 3 DataStorage Foundations of Computer Science ã Cengage Learning.
CSCE Fall 2012 Prof. Jennifer L. Welch.
Chapter 8 Computer Arithmetic
Storing Integers and Fractions
Introduction to Programming Part 3
Representation of real numbers
Binary & Hex Review.
Data Binary Arithmetic.
OBJECTIVES After reading this chapter, the reader should be able to :
Number Representations
1.6) Storing Integer: 1.7) storing fraction:
Two’s Complement & Binary Arithmetic
Presentation transcript:

Computer Organization CSCE 110 J. Michael Moore

High Level View Of A Computer Memory Input Processor Output Storage J. Michael Moore

Getting Data In Input Others? J. Michael Moore

Memory Input Processor Output Storage J. Michael Moore

Getting Data Out Output Others? J. Michael Moore

Memory Input Processor Output Storage J. Michael Moore

Unit of Storage Bit Two possible values OR Binary digit Memory Bit Binary digit Smallest unit of measurement Two possible values off OR on Storage J. Michael Moore

How Data Is Stored Byte: a group of 8 bits; 28=256 possibilities 00000000, 00000001, 00000010, 00000011, … , 11111111 Memory: long sequence of locations, each large enough to hold one byte, numbered 0, 1, 2, 3, … Address: The number of the location J. Michael Moore

How Data Is Stored Contents of a location can change bits 1 1 2 3... bytes Contents of a location can change e.g. 01011010 can become 11100001 Use consecutive locations to store longer sequences e.g. 4 bytes = 1 word J. Michael Moore

Binary Numbers Base Ten Numbers (Integers) Binary numbers are the same characters 0 1 2 3 4 5 6 7 8 9 5401 is 5x103 + 4x102 + 0x101 + 1x100 Binary numbers are the same 0 1 1011 is 1x23 + 0x22 + 1x21 + 1x20 J. Michael Moore

Converting Binary to Base 10 23 = 8 22 = 4 21 = 2 20 = 1 10012 = ____10 = 1x23 + 0x22 + 0x21+ 1x20 = 1x8 + 0x4 + 0x2 + 1x1 = 8 + 0 + 0 + 1 = 910 01102 = ____10 (Try yourself) 01102 = 610 J. Michael Moore

Converting Base 10 to Binary 28 = 256 27 = 128 26 = 64 25 = 32 24 = 16 23 = 8 22 = 4 21 = 2 20 = 1 38810 = ____2 388 - 256 (28) = 132 132 - 128 (27) = 4 4 - 4 (22) = 0 28 27 26 24 25 22 23 20 21 1 1 1 J. Michael Moore

Converting Base 10 to Binary 38810 = ____2 38810 / 2 = 19410 Remainder 0 19410 / 2 = 9710 Remainder 0 9710 / 2 = 4810 Remainder 1 4810 / 2 = 2410 Remainder 0 2410 / 2 = 1210 Remainder 0 1210 / 2 = 610 Remainder 0 610 / 2 = 310 Remainder 0 310 / 2 = 110 Remainder 1 28 27 26 24 25 22 23 20 21 110 / 2 = 010 Remainder 1 1 1 1 J. Michael Moore

Other common number representations Octal Numbers characters 0 1 2 3 4 5 6 7 8 7820 is 7x83 + 8x82 + 2x81 + 0x80 Hexadecimal Numbers 0 1 2 3 4 5 6 7 8 9 A B C D E F 2FD6 is 2x163 + Fx162 + Dx161 + 6x160 http://fac-staff.seattleu.edu/quinnm/web/education/JavaApplets/applets/NumConv.html J. Michael Moore

Negative Numbers Can we store a negative sign? What can we do? Use a bit Most common is two’s complement J. Michael Moore

Representing Negative Numbers Two’s Complement flip all the bits change 0 to 1 and 1 to zero add 1 if the leftmost bit is 0, the number is 0 or positive if the leftmost bit is 1, the number is negative J. Michael Moore

Two’s Complement What is -9? Addition and Subtraction are easy 9 is 00001001 in binary flip the bits - 11110110 add 1 - 11110111 Addition and Subtraction are easy always addition J. Michael Moore

Two’s Complement 1 1 1 = 4 Addition 13 - 9 = 4 13 + (-9) = 4 00001101 + 11110111 = ? But that doesn’t matter since we get the correct answer anyway 1 1 1 1 1 1 1 1 1 1 This bit is lost 1 = 4 J. Michael Moore

Real (Floating point) numbers Break the bits used into parts Sign bits 0110101000000011 Mantissa Exponent J. Michael Moore

Limitations of Finite Data Encodings Overflow - number is too large suppose 1 byte stores integers in base 2, from 0 (00000000) to 255 (11111111) (note: this is not two’s complement although it would have the same problem) if the byte holds 255, then adding 1 to it results in 0, not 256 http://www.artima.com/insidejvm/applets/InnerInt.html http://classes.engr.oregonstate.edu/eecs/fall2007/cs160/applets/TwosComplement.html J. Michael Moore

Limitations of Finite Data Exchange Roundoff Error Insufficient precision (size of word) ex. Try to store 1/8, which is 0.001 in binary, with only two bits Nonterminating expansions in current base ex. Try to store 1/3 in base 10, which is 0.3333… Nonterminating expansions in every base ex. Irrational numbers such as  J. Michael Moore

Memory Input Processor Output Storage J. Michael Moore