ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.

Slides:



Advertisements
Similar presentations
Princess Sumaya Univ. Computer Engineering Dept. د. بســام كحـالــه Dr. Bassam Kahhaleh.
Advertisements

HEXADECIMAL NUMBERS Code
Binary Systems1 DIGITAL LOGIC DESIGN by Dr. Fenghui Yao Tennessee State University Department of Computer Science Nashville, TN.
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
Lecturer: Omid Jafarinezhad Sharif University of Technology Department of Computer Engineering 1 Fundamental of Programming (C) Lecture 2 Number Systems.
ENGIN112 L4: Number Codes and Registers ENGIN 112 Intro to Electrical and Computer Engineering Lecture 4 Number Codes and Registers.
Chapter 1 Binary Systems 1-1. Digital Systems
Digital Fundamentals Floyd Chapter 2 Tenth Edition
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
CS 151 Digital Systems Design Lecture 3 More Number Systems.
CS 151 Digital Systems Design Lecture 4 Number Codes and Registers.
Level ISA3: Information Representation
CS 151 Digital Systems Design Lecture 2 Number Systems Prof. Ahmed Sameh Room 239A.
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
VIT UNIVERSITY1 ECE 103 DIGITAL LOGIC DESIGN CHAPTER I NUMBER SYSTEMS AND CODES Reference: M. Morris Mano & Michael D. Ciletti, "Digital Design", Fourth.
ENGIN112 L2: Number Systems September 5, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 2 Number Systems Russell Tessier KEB 309 G.
ENGIN112 L3: More Number Systems September 8, 2003 ENGIN 112 Intro to Electrical and Computer Engineering Lecture 3 More Number Systems.
COMP201 Computer Systems Number Representation. Number Representation Introduction Number Systems Integer Representations Examples  Englander Chapter.
Dr. Bernard Chen Ph.D. University of Central Arkansas
Chapter3 Fixed Point Representation Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
ACOE1611 Data Representation and Numbering Systems Dr. Costas Kyriacou and Dr. Konstantinos Tatas.
Numbering systems.
#1 Lec # 2 Winter EECC341 - Shaaban Positional Number Systems A number system consists of an order set of symbols (digits) with relations.
IT253: Computer Organization
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,
1 Digital Systems and Binary Numbers EE 208 – Logic Design Chapter 1 Sohaib Majzoub.
EE2174: Digital Logic and Lab Professor Shiyan Hu Department of Electrical and Computer Engineering Michigan Technological University CHAPTER 2 Number.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION.
Information Representation. Digital Hardware Systems Digital Systems Digital vs. Analog Waveforms Analog: values vary over a broad range continuously.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Number systems & Binary codes MODULE 1 Digital Logic Design Ch1-2 Outline of Chapter 1  1.1 Digital Systems  1.2 Binary Numbers  1.3 Number-base Conversions.
Lecture 4 Last Lecture –Positional Numbering Systems –Converting Between Bases Today’s Topics –Signed Integer Representation Signed magnitude One’s complement.
Cosc 2150: Computer Organization Chapter 2 Part 1 Integers addition and subtraction.
Chapter 1: Digital Computers and Information Illustration at beginning of each Chapter Base 10 Binary Base 2 Octal Base 8 Hex bas
Topic 1 – Number Systems. What is a Number System? A number system consists of an ordered set of symbols (digits) with relations defined for addition,
1 Representation of Data within the Computer Oct., 1999(Revised 2001 Oct)
Computer Math CPS120 Introduction to Computer Science Lecture 4.
AEEE2031 Data Representation and Numbering Systems.
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.
Chapter 1 Digital Systems and Binary Numbers
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
MECH1500 Chapter 3.
Chapter 1: Binary Systems
1 Digital Logic Design Lecture 2 More Number Systems/Complements.
CCE Department – Faculty of engineering - Islamic University of Lebanon Chapter 6 Binary Arithmetic.
CSC 331: DIGITAL LOGIC DESIGN COURSE LECTURER: E. Y. BAAGYERE. CONTACT: LECTURE TIME: 15:40 – 17:45 hrs. VENUE: SP-LAB.
ECE DIGITAL LOGIC LECTURE 3: DIGITAL COMPUTER AND NUMBER SYSTEMS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/19/2016.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 8 Dr. Shi Dept. of Electrical and Computer Engineering.
Chapter 1 Representing Data in a Computer. 1.1 Binary and Hexadecimal Numbers.
Lecture 1.2 (Chapter 1) Prepared by Dr. Lamiaa Elshenawy
CS151 Introduction to Digital Design Chapter 1: Digital Systems and Information Lecture 2 1Created by: Ms.Amany AlSaleh.
Digital Logic Design Ch1-1 Chapter 1 Digital Systems and Binary Numbers Mustafa Kemal Uyguroğlu Digital Logic Design I.
Number Systems. The position of each digit in a weighted number system is assigned a weight based on the base or radix of the system. The radix of decimal.
Binary Values. Numbers Natural Numbers Zero and any number obtained by repeatedly adding one to it. Examples: 100, 0, 45645, 32 Negative Numbers.
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.
Week 1(Number System) Muhammad Ammad uddin Logic Design Lab I (CEN211)
Chapter 1 Digital Systems and Binary Numbers
CHAPTER 1 INTRODUCTION NUMBER SYSTEMS AND CONVERSION
CHAPTER 1 : INTRODUCTION
Number Systems Give qualifications of instructors:
Chapter 3 Data Representation
Chapter 1 Digital Systems and Binary Numbers
BEE1244 Digital System and Electronics BEE1244 Digital System and Electronic Chapter 2 Number Systems.
INTRODUCTION TO LOGIC DESIGN Chapter 1 Digital Systems and Binary Numbers gürtaçyemişçioğlu.
Digital Systems and Binary Numbers
ECE 331 – Digital System Design
Presentation transcript:

ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi

Overview °The design of computers It all starts with numbers Building circuits Building computing machines °Digital systems °Understanding decimal numbers °Binary and octal numbers The basis of computers! °Conversion between different number systems

Digital Computer Systems °Digital systems consider discrete amounts of data. °Examples 26 letters in the alphabet 10 decimal digits °Larger quantities can be built from discrete values: Words made of letters Numbers made of decimal digits (e.g ) °Computers operate on binary values (0 and 1) °Easy to represent binary values electrically Voltages and currents. Can be implemented using circuits Create the building blocks of modern computers

Understanding Decimal Numbers °Decimal numbers are made of decimal digits: (0,1,2,3,4,5,6,7,8,9) °But how many items does a decimal number represent? 8653 = 8x x x x10 0 °What about fractions? = 9x x x x x x x10 -2 In formal notation -> ( ) 10

Understanding Octal Numbers °Octal numbers are made of octal digits: (0,1,2,3,4,5,6,7) °How many items does an octal number represent? (4536) 8 = 4x x x x8 0 = (1362) 10 °What about fractions? (465.27) 8 = 4x x x x x8 -2 °Octal numbers don’t use digits 8 or 9

Understanding Hexadecimal Numbers °Hexadecimal numbers are made of 16 digits: (0,1,2,3,4,5,6,7,8,9,A, B, C, D, E, F) °How many items does an hex number represent? (3A9F) 16 = 3x x x x16 0 = °What about fractions? (2D3.5) 16 = 2x x x x16 -1 = °Note that each hexadecimal digit can be represented with four bits. (1110) 2 = (E) 16 °Groups of four bits are called a nibble. (1110) 2

Understanding Binary Numbers °Binary numbers are made of binary digits (bits): 0 and 1 °How many items does an binary number represent? (1011) 2 = 1x x x x2 0 = (11) 10 °What about fractions? (110.10) 2 = 1x x x x x2 -2 °Groups of eight bits are called a byte ( ) 2 °Groups of four bits are called a nibble. (1101) 2

Why Use Binary Numbers? °Easy to represent 0 and 1 using electrical values. °Possible to tolerate noise. °Easy to transmit data °Easy to build binary circuits. AND Gate 1 0 0

Putting It All Together °Binary, octal, and hexadecimal similar °Easy to build circuits to operate on these representations °Possible to convert between the three formats

Binary Addition °Binary addition is very simple. °This is best shown in an example of adding two binary numbers… carries

Binary Subtraction °We can also perform subtraction (with borrows in place of carries). °Let’s subtract (10111) 2 from ( ) 2 … borrows

Binary Multiplication °Binary multiplication is much the same as decimal multiplication, except that the multiplication operations are much simpler… X

Conversion Between Number Bases Decimal(base 10) Octal(base 8) Binary(base 2) Hexadecimal (base16) °Learn to convert between bases.

Convert an Integer from Decimal to Binary 1.Divide decimal number by the base (e.g. 2) 2.The remainder is the lowest-order digit 3.Repeat first two steps until no divisor remains. For each digit position: Example for (13) 10: Integer Quotient 13/2 = 6 + ½ a 0 = 1 6/2 = a 1 = 0 3/2 = 1 + ½ a 2 = 1 1/2 = 0 + ½ a 3 = 1 RemainderCoefficient Answer (13) 10 = (a 3 a 2 a 1 a 0 ) 2 = (1101) 2

The Growth of Binary Numbers n2n2n 02 0 = = = = = = = =128 n2n2n 82 8 = = = = = =1M =1G =1T Mega Giga Tera

Converting Between Base 16 and Base 2 °Conversion is easy!  Determine 4-bit value for each hex digit °Note that there are 2 4 = 16 different values of four bits °Easier to read and write in hexadecimal. °Representations are equivalent! 3A9F 16 = A9F

Converting Between Base 16 and Base 8 1.Convert from Base 16 to Base 2 2.Regroup bits into groups of three starting from right 3.Ignore leading zeros 4.Each group of three bits forms an octal digit = A9F 16 = A9F

How To Represent Signed Numbers Plus and minus sign used for decimal numbers: 25 (or +25), -16, etc..For computers, desirable to represent everything as bits. Three types of signed binary number representations: signed magnitude, 1’s complement, 2’s complement. In each case: left-most bit indicates sign: positive (0) or negative (1). Consider signed magnitude: = Sign bitMagnitude = Sign bitMagnitude

One’s Complement Representation The one’s complement of a binary number involves inverting all bits. 1’s comp of is ’s comp of is For an n bit number N the 1’s complement is (2 n -1) – N. Called diminished radix complement by Mano since 1’s complement for base (radix 2). To find negative of 1’s complement number take the 1’s complement = Sign bitMagnitude = Sign bitMagnitude

Two’s Complement Representation The two’s complement of a binary number involves inverting all bits and adding 1. 2’s comp of is ’s comp of is For an n bit number N the 2’s complement is (2 n -1) – N + 1. Called radix complement by Mano since 2’s complement for base (radix 2). To find negative of 2’s complement number take the 2’s complement = Sign bitMagnitude = Sign bitMagnitude

Two’s Complement Shortcuts °Algorithm 1 – Simply complement each bit and then add 1 to the result. Finding the 2’s complement of ( ) 2 and of its 2’s complement… N = [N] = °Algorithm 2 – Starting with the least significant bit, copy all of the bits up to and including the first 1 bit and then complementing the remaining bits. N = [N] =

Finite Number Representation °Machines that use 2’s complement arithmetic can represent integers in the range -2 n-1 <= N <= 2 n-1 -1 where n is the number of bits available for representing N. Note that 2 n-1 -1 = ( ) 2 and –2 n-1 = ( ) 2 oFor 2’s complement more negative numbers than positive. oFor 1’s complement two representations for zero. oFor an n bit number in base (radix) z there are z n different unsigned values. (0, 1, …z n-1 )

1’s Complement Addition °Using 1’s complement numbers, adding numbers is easy. °For example, suppose we wish to add +(1100) 2 and +(0001) 2. °Let’s compute (12) 10 + (1) 10. (12) 10 = +(1100) 2 = in 1’s comp. (1) 10 = +(0001) 2 = in 1’s comp Add carry Final Result Step 1: Add binary numbers Step 2: Add carry to low-order bit Add

1’s Complement Subtraction °Using 1’s complement numbers, subtracting numbers is also easy. °For example, suppose we wish to subtract +(0001) 2 from +(1100) 2. °Let’s compute (12) 10 - (1) 10. (12) 10 = +(1100) 2 = in 1’s comp. (-1) 10 = -(0001) 2 = in 1’s comp Add carry Final Result Step 1: Take 1’s complement of 2 nd operand Step 2: Add binary numbers Step 3: Add carry to low order bit 1’s comp Add

2’s Complement Addition °Using 2’s complement numbers, adding numbers is easy. °For example, suppose we wish to add +(1100) 2 and +(0001) 2. °Let’s compute (12) 10 + (1) 10. (12) 10 = +(1100) 2 = in 2’s comp. (1) 10 = +(0001) 2 = in 2’s comp Final Result Step 1: Add binary numbers Step 2: Ignore carry bit Add Ignore

2’s Complement Subtraction °Using 2’s complement numbers, follow steps for subtraction °For example, suppose we wish to subtract +(0001) 2 from +(1100) 2. °Let’s compute (12) 10 - (1) 10. (12) 10 = +(1100) 2 = in 2’s comp. (-1) 10 = -(0001) 2 = in 2’s comp Final Result Step 1: Take 2’s complement of 2 nd operand Step 2: Add binary numbers Step 3: Ignore carry bit 2’s comp Add Ignore Carry

2’s Complement Subtraction: Example #2 °Let’s compute (13) 10 – (5) 10. (13) 10 = +(1101) 2 = (01101) 2 (-5) 10 = -(0101) 2 = (11011) 2 °Adding these two 5-bit codes… °Discarding the carry bit, the sign bit is seen to be zero, indicating a correct result. Indeed, (01000) 2 = +(1000) 2 = +(8) carry

2’s Complement Subtraction: Example #3 °Let’s compute (5) 10 – (12) 10. (-12) 10 = -(1100) 2 = (10100) 2 (5) 10 = +(0101) 2 = (00101) 2 °Adding these two 5-bit codes… °Here, there is no carry bit and the sign bit is 1. This indicates a negative result, which is what we expect. (11001) 2 = -(7)

ASCII Code °American Standard Code for Information Interchange °ASCII is a 7-bit code, frequently used with an 8 th bit for error detection (more about that in a bit). CharacterASCII (bin) ASCII (hex) DecimalOctal A B C … Z a … 1 ‘

ASCII Codes and Data Transmission °ASCII Codes °A – Z (26 codes), a – z (26 codes) °0-9 (10 codes), others °Complete listing in Mano text °Transmission susceptible to noise

Binary Data Storage Binary cells store individual bits of data Multiple cells form a register. Data in registers can indicate different values Hex (decimal) BCD ASCII Binary Cell

Register Transfer °Data can move from register to register. °Digital logic used to process data °We will learn to design this logic Register ARegister B Register C Digital Logic Circuits

Transfer of Information °Data input at keyboard °Shifted into place °Stored in memory NOTE: Data input in ASCII

Building a Computer °We need processing °We need storage °We need communication °You will learn to use and design these components.

Summary °Binary numbers are made of binary digits (bits) °Addition, subtraction, and multiplication in binary °Binary numbers can also be represented in octal and hexadecimal °Easy to convert between binary, octal, and hexadecimal °Signed numbers represented in signed magnitude, 1’s complement, and 2’s complement °2’s complement most important (only 1 representation for zero). °Important to understand treatment of sign bit for 1’s and 2’s complement. °ASCII code used to represent characters (including those on the keyboard) °Registers store binary data °Next time: Building logic circuits!