CMPE223/CMSE222 Digital Logic Design. Positional representation

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

Octal & Hexadecimal Number Systems. Digital Electronics

CHW 261: Logic Design

T02 Tutorial Slides for Week 2

Number representations

Number System. Introduction. Decimal Numbers

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

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

Digital Fundamentals

MACHINE LEVEL REPRESENTATION OF DATA

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

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

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

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

Data Representation COE 301. Computer Organization Prof. Muhamed Mudawar

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

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

CHAPTER 2 Number Systems

EE292: Fundamentals of ECE

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

2 Number Systems 2.1. Foundations of Computer Science Cengage Learning

World Inside a Computer is Binary

Chapter 1 Review of Number Systems

Number Systems CHAPTER Positional Number Systems

The. Binary. Number System

Level ISA3: Information Representation

Octal and Hexadecimal Integers

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

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

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

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

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

Binary Addition. Add the binary numbers and and show the equivalent decimal addition.

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

6. Binary and Hexadecimal

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

What Is It? Instruction Register Address Register Data Register

Chapter 2: Number Systems

Digital Logic Lecture 2 Number Systems

QUIZ: Generations of computer technology. Hardware:

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.

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

TOPIC: NUMBER SYSTEMS

Lecture 2: Number Systems

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

Chapter 2 Exercises and Answers

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

Slide Set 1. for ENEL 339 Fall 2014 Lecture Section 02. Steve Norman, PhD, PEng

Logical Bases: Representation of Numbers Decimal number Positional notation Binary numbers

CHAPTER 2 (b) : AND CODES

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

Korea University of Technology and Education

Computer Organization

Chapter 1 Preliminaries

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

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

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

CS 101: Computer Programming and Utilization

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

Digital Systems COE 202. Digital Logic Design. Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals

Lecture 1: Digital Systems and Number Systems

Final Labs and Tutors

Chapter 1 Emad Felemban

Chapter 2 Binary Values and Number Systems

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

Ms Sandhya Rani Dash UNIT 2: NUMBER SYSTEM AND CODES. 1.1 Introduction

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

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

Slide Set 1. for ENEL 353 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary

D I G I T A L C I R C U I T S E E

MC1601 Computer Organization

Chapter 5: Computer Arithmetic

Introduction to Numbering Systems

1.1. INTRODUCTION 1.2. NUMBER SYSTEMS

Digital Systems and Binary Numbers

Digital Fundamentals

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

Decimal & Binary Representation Systems. Decimal & Binary Representation Systems

Number Systems. Both numbers are positive

Arithmetic Processing

Basic Arithmetic (adding and subtracting)

Chapter 3: Number Systems and Codes. Textbook: Petruzella, Frank D., Programmable Logic Controllers. McGraw Hill Companies Inc.

Floating-Point Data Representation and Manipulation 198:231 Introduction to Computer Organization Lecture 3

1.3 Systems of numeration: To represent quantities in the different systems of numeration, specific symbols are used, which are also called ciphers.

COMP Overview of Tutorial #2

Fundamentals of Programming Session 2

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

Chapter 3: part 3 Binary Subtraction

Numeric Encodings Prof. James L. Frankel Harvard University

Number Systems & Encoding

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts. Chapter Overview. Welcome to Assembly Language

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

Outline. What Digit? => Number System. Decimal (base 10) Significant Digits. Lect 03 Number System, Gates, Boolean Algebra. CS221: Digital Design

CHAPTER 1 Numerical Representation

Microcomputers. Outline. Number Systems and Digital Logic Review

Chapter 2. Binary Values and Number Systems

QUIZ: Generations of computer technology. Hardware:

History of Computing. Ahmed Sallam 11/28/2014 1

Module 1: Information Representation I -- Number Systems

Transcription:

CMPE223/CMSE222 Digital Logic Design Number Representation and Arithmetic Circuits: Number Representation and Unsigned Addition Positional representation First consider integers Begin with positive only descriptions and expand to include negative numbers Numbers that are positive only are unsigned and numbers that can also assume negative values are signed For the decimal system: A number consists of digits having ten possible values (0-9) Each digit represents a multiple of a power of 10 (123) 10 =1x10 2 +2x10 1 +3x10 0 In general, an integer is represented by n decimal digits D=d n-1 d n-2...d 1 d 0 Representing the value V(D)=d n-1 x10 n-1 + d n-2 x10 n-2 +...+ d 1 x10 1 + d 0 x10 0 1

Positional representation Because the digits have 10 possible values and each digit is weighted as a power of 10, we say that decimal numbers are base-10 or radix-10 numbers In digital systems we commonly use the binary, or base-2, number system in which digits can be 0 or 1 Each digit is called a bit The positional representation is B=b n-1 b n-2...b 1 b 0 Representing a integer with the value V(B)=b n-1 x2 n-1 + b n-2 x2 n-2 +...+ b 1 x2 1 + b 0 x2 0 Positional representation The binary number 1101 represents the value So V=1x2 3 + 1x2 2 + 0x2 1 + 1x2 0 V=8+4+1=13 (1101) 2 =(13) 10 The range of numbers that can be represented by a binary number depends of the number of bits used In general, using n bits allows a representation of positive integers in the range 0 to 2 n -1 Most significant Bit (MSB) Least significant Bit (LSB) 2

Decimal/Binary conversion A binary number can be converted to a decimal number directly by evaluating the expression V(B)=b n-1 x2 n-1 + b n-2 x2 n-2 +...+ b 1 x2 1 + b 0 x2 0 Converting from a decimal to a binary number can be preformed by successively dividing the decimal number by 2 as follows Divide the decimal number (D) by 2 producing a quotient D/2 and a remainder. The remainder will be 0 or 1 (since we divide by 2) and will represent a single bit (the LSB) of the binary equivalent Repeatedly divide the generated quotient by 2 until the quotient=0. For each divide, the remainder represents one of the binary digits (bits) of the binary equivalent Decimal/Binary conversion 3

Octal and hexadecimal numbers Positional notation can be used for any radix (base). If the radix is r, then the number K=k n-1 k n-2...k 1 k 0 has the value i Numbers with radix-8 are called octal and numbers with radix-16 are called hexadecimal (or hex) For octal, digit values range from 0 to 7 For hex, digital values range from 0-9 and A-F ri n 1 V(K) Kir i 0 i Numbers in different systems Decimal Binary Octal Hex Decimal Binary Octal Hex 0 0000 0 0 8 1000 10 8 1 0001 1 1 9 1001 11 9 2 0010 2 2 10 1010 12 A 3 0011 3 3 11 1011 13 B 4 0100 4 4 12 1100 14 C 5 0101 5 5 13 1101 15 D 6 0110 6 6 14 1110 16 E 7 0111 7 7 15 1111 17 F 4

Binary to hex or octal conversion Group binary digits into groups of four and assign each group a hexadecimal digit. 0110 1011 0111 6 B 7 Binary-to-octal: 011 010 110 111 3 2 6 7 Hexadecimal-to-binary: A 1 9 1010 0001 1001 Octal-to-binary: 5 0 3 1 101 000 011 001 Unsigned number addition Additional of two 1-bit numbers gives four possible combinations carry sum x y c s x 0 0 1 1 0 0 0 0 + y + 0 + 1 + 0 + 1 0 1 0 1 c s 0 0 0 1 0 1 1 0 1 0 0 1 1 1 1 0 x y HA s c 5

Unsigned number addition Larger numbers have more bits involved There is still the need to add each pair of bits But, for each bit position i, the addition operation may include a carry-in from bit position i-1 X=x 4 x 3 x 2 x 1 x 0 0 1 1 1 1 (15) 10 Y=y 4 y 3 y 2 y 1 y 0 0 1 0 1 0 (10) 10 1 1 1 0 Generated carries S=s 4 s 3 s 2 s 1 s 0 1 1 0 0 1 (25) 10 Full adder (ignore the Map at this time) x i y i 00 01 11 10 c i x i y i carry sum c i 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 1 0 0 1 0 1 1 1 0 s i =x i y i c i 1 0 0 0 1 x i y c i i 00 01 11 10 1 0 1 1 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 1 1 c i =x i y i +y i c i +x i c i 6