Dr. Clincy Slide 1 CS 3510 - Chapter 2 (Part 1 of 3) Dr. Clincy Professor of CS Ch 2 Appendix pages 113-120 will not be on the exam – already covered this.

Slides:



Advertisements
Similar presentations
Number Systems and Codes
Advertisements

DATA REPRESENTATION CONVERSION.
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 2 Number Systems.
2.2 General Positional-Number-System Conversion
Level ISA3: Information Representation
Number Systems. 2 The total number of allowable symbols in a number system is called the radix or base of the system. Decimal Numbers: radix = 10 (symbols:
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Computer Systems 1 Fundamentals of Computing
Number Systems and Arithmetic
© Copyright 2000 Indiana University Board of Trustees Proficiency Quiz Study Guide Note: The following slides are provided courtesy of Dr. Bob Orr (Computer.
2.1 2 Number Systems Foundations of Computer Science  Cengage Learning.
Digital Logic Chapter 2 Number Conversions Digital Systems by Tocci.
Connecting with Computer Science 2 Objectives Learn why numbering systems are important to understand Refresh your knowledge of powers of numbers Learn.
Chapter 3 Data Representation
EX_01.1/46 Numeric Systems. EX_01.2/46 Overview Numeric systems – general, Binary numbers, Octal numbers, Hexadecimal system, Data units, ASCII code,
Data Representation in Computer Systems. 2 Objectives Understand the fundamentals of numerical data representation and manipulation in digital computers.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
Number systems, Operations, and Codes
Digital Logic Lecture 2 Number Systems
Positional Notation 642 in base 10 positional notation is:
CPIT 201 Introduction to Computing
Data Representation, Number Systems and Base Conversions
CS4500CS4500 Dr. ClincyLecture1 Lecture #6 Chapter 5: Addressing (part 1 of 3) Address Structure Classful Addressing Number Systems (Appendix B) Mask –
1 2.1 Introduction A bit is the most basic unit of information in a computer. –It is a state of “on” or “off” in a digital circuit. –Sometimes these states.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Computer Number System
Number Systems. Topics  The Decimal Number System  The Binary Number System  Converting from Binary to Decimal  Converting from Decimal to Binary.
 2012 Pearson Education, Inc. Slide Chapter 4 NumerationSystems.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
Cis303a_chapt03_exam1_answer.ppt CIS303A: System Architecture Exam 1: Chapter 3 Answer List the characters (digits) for the following bases. 1) Decimal:
Number Systems and Binary Arithmetic Quantitative Analysis II Professor Bob Orr.
Chapter 4 Numeration and Mathematical Systems © 2008 Pearson Addison-Wesley. All rights reserved.
CPIT 201 King AbdulAziz University Faculty of Computing & Information Technology Information Technology Department CH 2 Number Systems CPIT 201 Introduction.
ECE 2110: Introduction to Digital Systems Number Systems: conversions.
Digital logic COMP214  Lecture 2 Dr. Sarah M.Eljack Chapter 1 1.
Dr. ClincyLecture 2 Slide 1 CS Chapter 2 (1 of 5) Dr. Clincy Professor of CS Note: Do not study chapter 2’s appendix (the topics will be covered.
Cosc 2150: Computer Organization
Introduction To Number Systems
Digital Design Chapter One Digital Systems and Binary Numbers
Number Systems and Codes
Chapter 02 Nell Dale & John Lewis.
Integer Real Numbers Character Boolean Memory Address CPU Data Types
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Dr. Clincy Professor of CS
Introduction to Chapter 2
Data Representation in Computer Systems
Number Systems.
COMPUTING FUNDAMENTALS
ITE102 – Computer Programming (C++)
Number Systems Lab session 1 Xuan Guo.
Chapter 3 Data Representation
Tools of Web Development 1: Module A: Numbering Systems
Number System conversions
IT 0213: INTRODUCTION TO COMPUTER ARCHITECTURE
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
Number Systems and Binary Arithmetic
Number Systems and Codes
Dr. Clincy Professor of CS
Data Representation in Computer Systems
Numbering System TODAY AND TOMORROW 11th Edition
Digital Electronics and Microprocessors
Number Systems Lecture 2.
Digital Logic Design (CSNB163)
Chapter Four Data Representation in Computers By Bezawit E.
Number Systems Rayat Shikshan Sanstha’s
Numeral systems (radix)
Number Systems Rayat Shikshan Sanstha’s
Dr. Clincy Professor of CS
Dr. Clincy Professor of CS
Presentation transcript:

Dr. Clincy Slide 1 CS Chapter 2 (Part 1 of 3) Dr. Clincy Professor of CS Ch 2 Appendix pages will not be on the exam – already covered this under data-comm

2 Chapter 2 Objectives Understand the fundamental concepts of number systems. Understand the fundamental concepts of floating-point representation. Gain familiarity with the most popular character codes. Understand the concepts of error detecting and correcting. Dr. Clincy

3 Introduction A bit is the most basic unit of information in a computer. –Sometimes these states are “high” or “low” voltage or “on” or “off..” A byte is a group of eight bits. –A byte is the smallest possible addressable unit of computer storage. A word is a contiguous group of bytes. –Words can be any number of bits or bytes. –Word sizes of 16, 32, or 64 bits are most common. –In a word-addressable system, a word is the smallest addressable unit of storage. A group of four bits is called a nibble. –Bytes, therefore, consist of two nibbles: a “high-order nibble,” and a “low-order” nibble. Dr. Clincy

4 Positional Numbering Systems Review – Base 10 Numbers (Decimal) Base-10 The decimal number system is based on power of the base 10. For example, for the number 1259, the 9 is in the 10^0 column - 1s column the 5 is in the 10^1 column - 10s column the 2 is in the 10^2 column - 100s column the 1 is in the 10^3 column s column 1259 is 9 X 1 = X 10 = X 100 = X 1000 =

Dr. Clincy5 Positional Numbering Systems Introducing Base 2 (Binary) and Base 16 (Hex) Number Systems Base-2 (Binary) The Binary number system uses the same mechanism and concept however, the base is 2 versus 10 The place values for binary are based on powers of the base 2: … 2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^ Base-16 (Hex) The hexadecimal number system is based 16, and uses the same mechanisms and conversion routines we have already examined. The place values for hexadecimal are based on powers of the base 16 The digits for are the letters A - F (A is 10, …….., F is 15) …….. 16^3 16^2 16^1 16^

Dr. Clincy6 5-bit Binary Number System 2 4, 2 3, 2 2, 2 1, , 8, 4, 2, 1

Dr. Clincy7 Different Number Systems Base-10 (Decimal) – what are the characters ? Example = 659 Base-2 (Binary) – what are the characters ? Example = 1101 Base-16 (Hex) – what are the characters ? Example = AE Base-8 (Octal) – what are the characters ? Example = 73

8 Converting 190 to base 3... –3 5 = 243 is too large, so we try 3 4 = 81. And 2 times 81 doesn’t exceed 190 –The last power of 3, 3 0 = 1, is our last choice, and it gives us a difference of zero. –Our result, reading from top to bottom is: = Converting Between Bases – Subtraction Method Dr. Clincy

9 Converting 190 to base 3... –Continue in this way until the quotient is zero. –In the final calculation, we note that 3 divides 2 zero times with a remainder of 2. –Our result, reading from bottom to top is: = Converting Between Bases –Division Method Dr. Clincy

10 Converting from Binary to Decimal So, the binary number can be converted to a decimal number 1 X 1 = 1 (right most bit or position) 1 X 2 = 2 0 X 4 = 0 0 X 8 = 0 1 X 16 = 16 1 X 32 = 32 0 X 64 = 0 1 X 128 = 128 (left most bit or position) in decimal

Dr. Clincy11 Converting from Decimal to Binary To convert from decimal to some other number system requires a different method called the division/remainder method. The idea is to repeatedly divide the decimal number and resulting quotients by the number system’s base. The answer will be the remainders. Example: convert 155 to binary (Start from the top and work down) 155/2 Q = 77, R = 1 (Start) 77/2 Q = 38, R = 1 38/2 Q = 19, R = 0 19/2 Q = 9, R = 1 9/2 Q = 4, R = 1 4/2 Q = 2, R = 0 2/2 Q = 1, R = 0 1/2 Q = 0, R = 1 (Stop) Answer is Be careful to place the digits in the correct order.

12 Why Decimal, Binary and Hex ? Give subscripts for Decimal, Binary, Hex, Octal Converting Between Bases Dr. Clincy

13 Using groups of hextets, the binary number (= ) in hexadecimal is: Octal (base 8) values are derived from binary by using groups of three bits (8 = 2 3 ): Octal was very useful when computers used six-bit words. If the number of bits is not a multiple of 4, pad on the left with zeros. Converting Between Bases of Power 2 Dr. Clincy

14 Fractional decimal values have nonzero digits to the right of the decimal point. Fractional values of other radix systems have nonzero digits to the right of the radix point. Numerals to the right of a radix point represent negative powers of the radix: = 4   = 1   2 -2 = ½ + ¼ = = 0.75 Converting Between Bases Dr. Clincy

15 The calculation to the right is an example of using the subtraction method to convert the decimal to binary. –Our result, reading from top to bottom is: = –Of course, this method works with any base, not just binary. Subtraction - Converting Between Bases Dr. Clincy

16 Converting to binary... –Multiplication Method: You are finished when the product is zero, or until you have reached the desired number of binary places. –Our result, reading from top to bottom is: = –This method also works with any base. Just use the target radix as the multiplier. Multiplication - Converting Between Bases Dr. Clincy

17 Converting Number Systems

Dr. ClincyLecture18 Addition Dr. Clincy18

Dr. ClincyLecture19 Addition & Subtraction Dr. Clincy19

What about multiplication in base 2 By hand - For unsigned case, very similar to base-10 multiplication Dr. ClincyLecture20Dr. Clincy20

Dr. ClincyLecture21 Division Dr. Clincy21