Positional notation Ch Conversions between Decimal and Binary. /continued. Binary to Decimal

Similar documents
Basic Definition INTEGER DATA. Unsigned Binary and Binary-Coded Decimal. BCD: Binary-Coded Decimal

Number Systems and Binary Arithmetic. Quantitative Analysis II Professor Bob Orr

CMPE223/CMSE222 Digital Logic Design. Positional representation

Number Systems and Conversions UNIT 1 NUMBER SYSTEMS & CONVERSIONS. Number Systems (2/2) Number Systems (1/2) Iris Hui-Ru Jiang Spring 2010

Chapter 2 Binary Values and Number Systems

CS & IT Conversions. Magnitude 10,000 1,

COE 202- Digital Logic. Number Systems II. Dr. Abdulaziz Y. Barnawi COE Department KFUPM. January 23, Abdulaziz Barnawi. COE 202 Logic Design

Level ISA3: Information Representation

T02 Tutorial Slides for Week 2

Number Systems. Both numbers are positive

MC1601 Computer Organization

Number representations

CHW 261: Logic Design

Octal and Hexadecimal Integers

Electronic Data and Instructions

Lecture 2: Number Systems

1010 2?= ?= CS 64 Lecture 2 Data Representation. Decimal Numbers: Base 10. Reading: FLD Digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Octal & Hexadecimal Number Systems. Digital Electronics

Number Systems Standard positional representation of numbers: An unsigned number with whole and fraction portions is represented as:

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Lecture (01) Digital Systems and Binary Numbers By: Dr. Ahmed ElShafee

MACHINE LEVEL REPRESENTATION OF DATA

QUIZ: Generations of computer technology. Hardware:

Number System. Introduction. Decimal Numbers

What Is It? Instruction Register Address Register Data Register

Digital Arithmetic. Digital Arithmetic: Operations and Circuits Dr. Farahmand

BINARY SYSTEM. Binary system is used in digital systems because it is:

DLD VIDYA SAGAR P. potharajuvidyasagar.wordpress.com. Vignana Bharathi Institute of Technology UNIT 1 DLD P VIDYA SAGAR

Introduction to Numbering Systems

Digital Fundamentals. CHAPTER 2 Number Systems, Operations, and Codes

COE 202: Digital Logic Design Number Systems Part 2. Dr. Ahmad Almulhem ahmadsm AT kfupm Phone: Office:

COMP Overview of Tutorial #2

Chapter 2. Binary Values and Number Systems

QUIZ: Generations of computer technology. Hardware:

Number Systems MA1S1. Tristan McLoughlin. November 27, 2013

Computer Sc. & IT. Digital Logic. Computer Sciencee & Information Technology. 20 Rank under AIR 100. Postal Correspondence

UNIT 7A Data Representation: Numbers and Text. Digital Data

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

Chapter 1 Preliminaries

Module 1: Information Representation I -- Number Systems

Number Systems. TA: Mamun. References: Lecture notes of Introduction to Information Technologies (ITEC 1011) by Dr Scott MacKenzie

CS/EE1012 INTRODUCTION TO COMPUTER ENGINEERING SPRING 2013 HOMEWORK I. Solve all homework and exam problems as shown in class and sample solutions

Chapter 2. Positional number systems. 2.1 Signed number representations Signed magnitude

Chapter 2 Exercises and Answers

A complement number system is used to represent positive and negative integers. A complement number system is based on a fixed length representation

Digital Fundamentals

Lecture (01) Introduction Number Systems and Conversion (1)

CHAPTER 2 (b) : AND CODES

in this web service Cambridge University Press

CHAPTER 2 Number Systems

Signed Binary Numbers

World Inside a Computer is Binary

Chapter 3: Arithmetic for Computers

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

Rui Wang, Assistant professor Dept. of Information and Communication Tongji University.

EE292: Fundamentals of ECE

TOPICS. Other Number Systems. Other Number Systems 9/9/2017. Octal Hexadecimal Number conversion

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Numeral Systems. -Numeral System -Positional systems -Decimal -Binary -Octal. Subjects:

Bits. Binary Digits. 0 or 1

Chapter (1) Eng. Mai Z. Alyazji

Chapter 03: Computer Arithmetic. Lesson 09: Arithmetic using floating point numbers

Fundamentals of Programming Session 2

The. Binary. Number System

Introduction to Computer Science-103. Midterm

Chapter 1 Emad Felemban

6. Binary and Hexadecimal

Introduction to Computers and Programming. Numeric Values

CS 265. Computer Architecture. Wei Lu, Ph.D., P.Eng.

Chapter 1 Review of Number Systems

Digital Systems and Binary Numbers

Number Systems CHAPTER Positional Number Systems

Digital Logic. The Binary System is a way of writing numbers using only the digits 0 and 1. This is the method used by the (digital) computer.

The Design of C: A Rational Reconstruction

Switching Circuits and Logic Design Prof. Indranil Sengupta Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

The Design of C: A Rational Reconstruction"

CS 121 Digital Logic Design. Chapter 1. Teacher Assistant. Hadeel Al-Ateeq

Final Labs and Tutors

CS 31: Intro to Systems Binary Representation. Kevin Webb Swarthmore College January 27, 2015

DATA REPRESENTATION. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift, Jaipur Region. Based on CBSE curriculum Class 11. Neha Tyagi, KV 5 Jaipur II Shift

IT 1204 Section 2.0. Data Representation and Arithmetic. 2009, University of Colombo School of Computing 1

Objectives. Connecting with Computer Science 2

data within a computer system are stored in one of 2 physical states (hence the use of binary digits)

Logic Circuits I ECE 1411 Thursday 4:45pm-7:20pm. Nathan Pihlstrom.

Chapter 5: Computer Arithmetic. In this chapter you will learn about:

Fundamentals of Programming (C)

Number Systems. Readings: , Problem: Implement simple pocket calculator Need: Display, adders & subtractors, inputs

Korea University of Technology and Education

Introduction to Computer Science (I1100) With 1 coin 2 possibilities: Head / Tail or 0/1

Number Systems. Binary Numbers. Appendix. Decimal notation represents numbers as powers of 10, for example

Beyond Base 10: Non-decimal Based Number Systems

Numbering systems. Dr Abu Arqoub

Lecture 1: Digital Systems and Number Systems

Learning Objectives. Binary over Decimal. In this chapter you will learn about:

CPS 104 Computer Organization and Programming Lecture-2 : Data representations,

Chapter 4 Section 2 Operations on Decimals

Moodle WILLINGDON COLLEGE SANGLI. ELECTRONICS (B. Sc.-I) Introduction to Number System

LECTURE 1-2. Introduction and Number Systems

Number Systems & Encoding

9/23/15. Agenda. Goals of this Lecture. For Your Amusement. Number Systems and Number Representation. The Binary Number System

Transcription:

Positional notation Ch.. /continued Conversions between Decimal and Binary Binary to Decimal - use the definition of a number in a positional number system with base - evaluate the definition formula using decimal arithmetic 54 position = corresponding power of 5 4 = + + + + + = 4 (decimal) d 5 d 4 d d d d Decimal to Binary - repeatedly divide by - remainder is the next digit - binary number is developed right to left 7 86 86 4 4 5 5 CSE 5 Week. May 5, 4 page

What is going on in the repeated division by? 4 5 5 5 4 4 (decimal) = + + + + + 4 produces a quotient of, with a remainder of 4 4 = + + + + + 4 (decimal) = + + + + produces a quotient of, with a remainder of = + + + + (decimal) = + + + produces a quotient of 5, with a remainder of = + + + 5 (decimal) = + + 5 produces a quotient of, with a remainder of 5 = + + (decimal) = + produces a quotient of, with a remainder of = + (decimal) = produces a quotient of, with a remainder of = + CSE 5 Week. May 5, 4 page

Generalization: Conversions between Decimal and base b base b to Decimal - use the definition of a number in a positional number system with base b - evaluate the definition formula using decimal arithmetic Decimal to base b - repeatedly divide by b - remainder is the next digit - base b number is developed right to left Conversions between Binary and Octal/Hexadecimal Binary to Octal - group bits into threes, right to left - convert each such group to an octal digit = = 7 (octal) Binary to Hexadecimal - group bits into fours, right to left - convert each such group to a hexadecimal digit = = CB (hexadecimal) CSE 5 Week. May 5, 4 page

Octal to Binary - convert each octal digit to a three-bit binary representation 75 = = (binary) Hexadecimal to Binary - convert each octal digit to a four-bit binary representation AF = = (binary) You need the following tables in the above conversion processes: (These can easily be reconstructed in the margins of a test paper when needed) Binary Octal Binary Hexadecimal Octal Binary Hex Binary Digits Digits 8 9 () A () B 4 4 () C 5 5 () D 6 6 (4) E 7 7 (5) F CSE 5 Week. May 5, 4 page 4

What about converting between Octal and Hexadecimal? Octal to Hexadecimal: Convert Octal to Binary and then convert Binary to Hexadecimal. Hexadecimal to Octal: Convert Hexadecimal to Binary and then convert Binary to Octal. CSE 5 Week. May 5, 4 page 5

Chapter Data Representation Data and computers Ch.. everything inside a computer is stored as patterns of s and s. numbers, text, audio, video, images, graphics, etc. how do you convert it to s and s. how do you store the s and s efficiently. Representing Numeric data Ch.. Representing Natural numbers with a finite number of digits General Property Number of digits Min Max n n b s: b=, n= to 999 b=, n= to (equivalent to to 7, in decimal) b=8, n= to 777 (equivalent to to 5, in decimal) b=6, n= to FFF (equivalent to to, in decimal) CSE 5 Week. May 5, 4 page 6

Representing Negative Number (Integers) Basic Definition an integer is a number which has no fractional part s: + -67 Integers (Signed, natural numbers) previously: unsigned numbers only, i.e. natural numbers need mechanism to represent both positive and negative numbers two schemes: ) sign-magnitude, ) complementary representation Sign-Magnitude in binary: sign: left-most bit ( = positive, = negative) magnitude: remaining bits : (using 6-bit sign-magnitude representation) +5 = -5 = Ranges Binary Unsigned Sign-Magnitude (Natural Number) (Integer) Number of bits Min Max Min Max + 7 + 4 5 7 +7 5 5 +5 6 6 + etc. n n n n CSE 5 Week. May 5, 4 page 7

Difficulties with Sign-Magnitude two representations for zero + = - = arithmetic is awkward, especially subtraction Complementary Representation positive numbers are represented by their corresponding natural numbers negative numbers are represented as (very) large natural numbers subtraction reduces to addition negative numbers: x b n x : Let b and n Positive Negative numbers numbers (+) (+) 99 (-) (+) 98 (-) (+) 97 (-)...... (+49) 49 5 (-49) 5 (-5) CSE 5 Week. May 5, 4 page 8

Visualization: -49-5 +49 5 5 49 99 - + + 5 98 99 49-5 - - + + + +49 CSE 5 Week. May 5, 4 page 9