Digital Systems and Binary Numbers

Similar documents
Korea University of Technology and Education

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

Chapter 1. Digital Systems and Binary Numbers

Lecture (02) Operations on numbering systems

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

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

SE311: Design of Digital Systems

Digital Systems and Binary Numbers

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

Digital Systems and Binary Numbers

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

Lecture 2: Number Systems

MC1601 Computer Organization

Digital Fundamentals

DIGITAL SYSTEM DESIGN

CHAPTER V NUMBER SYSTEMS AND ARITHMETIC

Chapter 1 Review of Number Systems

Electronics Engineering ECE / E & T

CHAPTER TWO. Data Representation ( M.MORRIS MANO COMPUTER SYSTEM ARCHITECTURE THIRD EDITION ) IN THIS CHAPTER

Binary Systems and Codes

Number System. Introduction. Decimal Numbers

CHW 261: Logic Design

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

Lecture (03) Binary Codes Registers and Logic Gates

CS & IT Conversions. Magnitude 10,000 1,

Computer Organization

MYcsvtu Notes DATA REPRESENTATION. Data Types. Complements. Fixed Point Representations. Floating Point Representations. Other Binary Codes

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

Chapter 3: part 3 Binary Subtraction

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

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

Chapter 1 Emad Felemban

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

Numbering systems. Dr Abu Arqoub

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

Introduction to Numbering Systems

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

Digital Fundamentals

Chapter 4 Arithmetic Functions

UNIT - I: COMPUTER ARITHMETIC, REGISTER TRANSFER LANGUAGE & MICROOPERATIONS

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

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

MACHINE LEVEL REPRESENTATION OF DATA

Number Systems CHAPTER Positional Number Systems

Logic and Computer Design Fundamentals. Chapter 1 Digital Computers and Information

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

Number representations

in this web service Cambridge University Press

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

Review of Number Systems

CHAPTER 2 (b) : AND CODES

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

ECE/Comp Sci 352 Digital Systems Fundamentals. Charles R. Kime Section 2 Fall Logic and Computer Design Fundamentals

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

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

Semester Transition Point. EE 109 Unit 11 Binary Arithmetic. Binary Arithmetic ARITHMETIC

LOGIC DESIGN. Dr. Mahmoud Abo_elfetouh

Digital Fundamentals

Microcomputers. Outline. Number Systems and Digital Logic Review

Agenda EE 224: INTRODUCTION TO DIGITAL CIRCUITS & COMPUTER DESIGN. Lecture 1: Introduction. Go over the syllabus 3/31/2010

COMP Overview of Tutorial #2

Chapter 2. Data Representation in Computer Systems

Number Systems. Dr. Tarek A. Tutunji Philadelphia University, Jordan

6. Binary and Hexadecimal

Binary. Hexadecimal BINARY CODED DECIMAL

Chap 1. Digital Computers and Information

Arithmetic Processing

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

CHAPTER 1 Numerical Representation

DIGITAL SYSTEM FUNDAMENTALS (ECE 421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE 422) COURSE / CODE NUMBER SYSTEM

Chapter 5: Computer Arithmetic

The. Binary. Number System

Number Systems Base r

Chap.3 3. Chap reduces the complexity required to represent the schematic diagram of a circuit Library

Objectives. Connecting with Computer Science 2

EE 109 Unit 6 Binary Arithmetic

Positional Number System

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

NUMBER SYSTEMS AND CODES

Excerpt from: Stephen H. Unger, The Essence of Logic Circuits, Second Ed., Wiley, 1997

Chapter 2: Number Systems

(+A) + ( B) + (A B) (B A) + (A B) ( A) + (+ B) (A B) + (B A) + (A B) (+ A) (+ B) + (A - B) (B A) + (A B) ( A) ( B) (A B) + (B A) + (A B)

Chapter (1) Eng. Mai Z. Alyazji

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

9/3/2015. Data Representation II. 2.4 Signed Integer Representation. 2.4 Signed Integer Representation

Lecture 1: Digital Systems and Number Systems

Level ISA3: Information Representation

Number Systems. Both numbers are positive

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

CMPE223/CMSE222 Digital Logic Design. Positional representation

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

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

10.1. Unit 10. Signed Representation Systems Binary Arithmetic

Electronic Data and Instructions

Chapter 2 Bits, Data Types, and Operations

2.1. Unit 2. Integer Operations (Arithmetic, Overflow, Bitwise Logic, Shifting)

Advanced Computer Architecture-CS501

EE292: Fundamentals of ECE

COMPUTER ARITHMETIC (Part 1)

World Inside a Computer is Binary

Transcription:

Digital Systems and Binary Numbers Mano & Ciletti Chapter 1 By Suleyman TOSUN Ankara University

Outline Digital Systems Binary Numbers Number-Base Conversions Octal and Hexadecimal Numbers Complements Signed Binary Numbers Binary Codes Binary Storage and Registers Binary Logic

Digital Systems Digital computer is the best-known example of a digital system Others are telephone switching exchanges, digital voltmeters, digital calculators, etc. A digital system manipulates discrete elements of information Discrete elements: electric impulses, decimal digits, letters of an alphabet, any other set of meaningful symbols

Digital Systems In a digital system, discrete elements of information are represented by signals Electrical signals (voltages & currents) are the most common Present day systems have only two discrete values (binary) Alternative, many-valued circuits are less reliable A lot of information is already discrete and continuous values can be quantized (sampled)

Digital Systems

Digital Systems A digital computer is an interconnection of digital modules To understand each module, it is necessary to have a basic knowledge of digital systems

Binary Numbers 7392 represents a quantity that is equal to Decimal number system is of base (or radix) 10 In binary system, possible values are 0 and 1 and each digit is multiplied by E.g. 11010.11 is

Binary Numbers Hexadecimal (base 16) numbers use digits 0-9 and letters A, B, C, D, E, F to represent values 10-15 Operations work similarly in all bases

Number-Base Conversions Converting a number from base x to decimal is simple (as shown before) Decimal to base x is easier if number is separated into integer and fraction parts Convert 41 to binary Divide 41 by 2, quotient is 20 and remainder is 1. Continue dividing the quotient until it becomes 0. Remainders give us the binary number as follows:

Number-Base Conversions

Number-Base Conversions Conversion of a fraction is similar but the number is multiplied by to instead of dividing

Octal and Hexadecimal Numbers Conversions between binary, octal and hexadecimal numbers are easier Each octal digit corresponds to 3 binary digits and each hexadecimal digit corresponds to 4 binary digits

Complements Simplifies the subtraction operation Logical operations Two types exist The radix complement (r s complement) 10 s complement, 2 s complement The diminished radix complement ((r-1) s complement) 9 s complement, 1 s complement

Diminished Radix (r-1) complement Given a number N in base r having n digits: (r-1) s complement of N is (r n -1)-N When r=10, (r-1) s complement is called 9 s complement. 10 n -1 is a number represented by n 9 s. 9 s complement of 546700 is (n=6) 999999-546700=453299 9 s complement of 012398 is (n=6) 999999-012398=987601

1 s complement For binary numbers, r=2 and r-1=1. 1 s complement of N is (2 n -1)-N If n=4, 2 n =10000. So, 2 n -1=1111. To determine the 1 s complement of a number, subtract each digit from 1. Or, bit flip!!! Replace 0 s with 1 s, 1 s with 0 s!!! Example: If N= 1011000, 1 s comp.= 0100111 If N= 010110, 1 s comp.= 101001

Radix (r s) complement Given a number N in base r having n digits: r s complement of N is r n -N When r=10, r s complement is called 10 s complement. 10 s complement of 546700 is (n=6) 1000000-546700=453300 10 s complement of 012398 is (n=6) 1000000-012398=987602

2 s complement For binary numbers, r=2, 2 s complement of N is 2 n -N To determine the 2 s complement of a number, determine 1 s complement and add 1 to it. Example: If N= 1011001, 1 s comp.= 0100110, 2 s comp.=0100111 If N= 1101100, 2 s comp.= 0010100 Another way of finding 2 s comp.: Leave all least significant 0 s and the first 1 unchanged, bit flip the remaning digits.

Subtraction with Complements Minuend: 101101 Subtrahend: 100111 Difference: 000110 1. Add the minuend M to r s complement of the subtrahend N. M + (r n -N) = M - N+r n 2. If M>=N, the sum will produce an end carry. Discard it and what is left is the result M-N. 3. If M<N, the sum does not produce an end carry and is equal to r n -(N-M). To obtain the answer in a familiar form, take the r s complement of the sum and place a negative sign in front.

Example

Example

Example

Signed Binary Numbers Negative numbers is shown with a minus sign in math. In digital systems, the first bit decides the sign of the number. If the first bit 0, the number is positive. If the first bit 1, the number is negative. This is called signed magnitude convention.

Signed complement systems To represent negative number, 1 s complement and 2 s complements are also used.

Example Represent +9 and -9 in eight bit system +9 is same for all systems: 00001001-9

To determine negative number Signed magnitute: Take the positive number, change the most significant bit to 1 One s complement: Take the one s complement of the positive number. Two s complement: Take the two s complement of the positive number. (Or add 1 to one s complement)

Arithmetic Addition

Aritmetic subtraction Take the 2 s complement of subtrahend. Add it to the minuend. Discard cary if there is any. Examples: 10-5 (8 bits), -3-5, 18-(-9)

Binary Codes BCD Codes n bit can code upto 2 n combinations.

BCD Addition

Example

Other Decimal Codes

Gray Codes Only one bit changes when going from one number to the next. How to determine the gray code equivalent of a number: Add 0 to the left of number. XOR every two neigboring pair in order. The result is the gray code. Example: 1 1 0 0 0 0 -> 0 1 1 0 0 0 0 1 0 1 0 0 0

Error Detecting Codes Add an extra bit (parity bit) to make the total number of one s either even or odd.

Binary logic

Truth tables

Gate sysbols

Timing diagrams

More than two inputs