Digital Logic Design Lecture # 3 University of Tehran.

Slides:



Advertisements
Similar presentations
EET 1131 Unit 7 Arithmetic Operations and Circuits
Advertisements

COE 202: Digital Logic Design Signed Numbers
A digital system is a system that manipulates discrete elements of information represented internally in binary form. Digital computers –general purposes.
ECE 331 – Digital System Design
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, Java Version, Third Edition.
Chapter 1 Binary Systems 1-1. Digital Systems
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Third Edition.
Digital Fundamentals Floyd Chapter 2 Tenth Edition
1 Information Representation (level ISA-3) Signed numbers and bit-level operations.
Assembly Language and Computer Architecture Using C++ and Java
CS 61C L02 Number Representation (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c CS61C.
CSC 110 – Intro to Computing Lecture 14: Midterm Review.
1 Binary Arithmetic, Subtraction The rules for binary arithmetic are: = 0, carry = = 1, carry = = 1, carry = = 0, carry =
CSCE 211: Digital Logic Design Chin-Tser Huang University of South Carolina.
1 Binary Numbers Again Recall that N binary digits (N bits) can represent unsigned integers from 0 to 2 N bits = 0 to 15 8 bits = 0 to bits.
Lecture # 12 University of Tehran
Mantıksal Tasarım – BBM231 M. Önder Efe
1.6 Signed Binary Numbers.
Digital Logic Design Lecture # 8 University of Tehran.
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
© 2009 Pearson Education, Upper Saddle River, NJ All Rights ReservedFloyd, Digital Fundamentals, 10 th ed Digital Fundamentals Tenth Edition Floyd.
Lecture 5.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Logic and data representation Revision. AND gate A B A B All inputs have to be true ( i.e 1) for the output of the gate to be high, in all other cases.
Computer Arithmetic Nizamettin AYDIN
Digital Logic Design Lecture # 7 University of Tehran.
Basic Arithmetic (adding and subtracting)
Logic and Digital System Design - CS 303
IT253: Computer Organization
ECEN2102 Digital Logic Design Lecture 1 Numbers Systems Abdullah Said Alkalbani University of Buraimi.
Digital Logic Design Lecture 3 Complements, Number Codes and Registers.
CS151 Introduction to Digital Design
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
CE1111 :Digital Logic Design lecture 01 Introduction Dr. Atef Ali Ibrahim.
ECE 301 – Digital Electronics Unsigned and Signed Numbers, Binary Arithmetic of Signed Numbers, and Binary Codes (Lecture #2)
Digital Logic Design Lecture # 9 University of Tehran.
1 Lecture 3 ENGRE 254 1/14/09. 2 Lecture 1 review Digital signals assume two values represented by “0” and “1”. Typically a “0” represents a voltage near.
Arithmetic Logic Unit (ALU) Anna Kurek CS 147 Spring 2008.
Digital Logic Design Lecture # 2 University of Tehran.
Half Adder & Full Adder Patrick Marshall. Intro Adding binary digits Half adder Full adder Parallel adder (ripple carry) Arithmetic overflow.
Sep 29, 2004Subtraction (lvk)1 Negative Numbers and Subtraction The adders we designed can add only non-negative numbers – If we can represent negative.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
ECE 301 – Digital Electronics Representation of Negative Numbers, Binary Arithmetic of Negative Numbers, and Binary Codes (Lecture #11) The slides included.
Kavita Bala CS 3410, Spring 2014 Computer Science Cornell University.
Digital Logic Lecture 3 Binary Arithmetic By Zyad Dwekat The Hashemite University Computer Engineering Department.
Outline MSI Parts as a Decoder Multiplexer Three State Buffer MSI Parts as a Multiplexer Realization of Switching Functions Using Multiplexers.
Digital Fundamentals Tenth Edition Floyd Chapter 2 © 2008 Pearson Education.
Outline Binary Addition 2’s complement Binary Subtraction Half Adder
Chapter 1: Binary Systems
Digital Logic Design Lecture # 6 University of Tehran.
Lecture # 5 University of Tehran
Introduction to Digital Electronics Lecture 2: Number Systems.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
BINARY SYSTEMS ENGR. KASHIF SHAHZAD 1. BINARY NUMBERS 1/2 Internally, information in digital systems is of binary form groups of bits (i.e. binary numbers)
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
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.
Lecture 4: Digital Systems & Binary Numbers (4)
Computer Representation of Information
Unit 1 Introduction Number Systems and Conversion.
Invitation to Computer Science, C++ Version, Fourth Edition
ELECTRONICS AND COMMUNICATION ENGINEERING
Binary Arithmetic Binary arithmetic is essential in all digital computers and in many other types of digital systems. Addition, Subtraction, Multiplication,
University of Gujrat Department of Computer Science
Invitation to Computer Science, Java Version, Third Edition
Data Representation Data Types Complements Fixed Point Representation
Digital Electronics & Logic Design
Subtraction The arithmetic we did so far was limited to unsigned (positive) integers. Today we’ll consider negative numbers and subtraction. The main problem.
2’s Complement form 1’s complement form 2’s complement form
ECE 331 – Digital System Design
Presentation transcript:

Digital Logic Design Lecture # 3 University of Tehran

Outline Review of Lecture #2 Number Systems 1’s Complement System Binary Coded System (BCD) ASCII Code System Overflow Designing an Overflow Detector Structure of NMOS and PMOS Transistors Designing Logical Gates Using Transistors

Review of Lecture #2 In the last session, we covered three types of coding (representation) in our look at different number systems: Binary System, Sign and Magnitude System and 2’s Complement System. Quote: The 2’s Complement System was preferred due to it’s easier arithmetic: A – B = A + (-B)

Review of Lecture #2 (continued…) Note: The 2’s complement system is unbalanced, meaning that there is always one more negative number represented than the positive numbers. In the 2’s complement system with 4 bits, numbers range from -8 to +7, and there’s no representation for +8.

Review of Lecture #2 (continued…)

Number Systems 1’s Complement System Binary Coded System (BCD) ASCII Code

1’s Complement System This system was more widely used historically. Unlike the 2’s complement system, this system is balanced. When 1’s complementing a number, we simply change the value of each bit in the representation.

1’s Complement System (continued…) It’s main setback is that it doesn’t perform as well as the 2’s complement system in arithmetic operations. This is because the results need adjusting after addition and subtraction. In order to adjust the results of addition and subtraction, it is necessary to add carry with the result if the operation has had a carry. Example:

Binary Coded System (BCD) Number system are not always used for arithmetic. Thus a number system such as BCD that could represent digits separately would give a positive state of thought in some cases. An example for the case mentioned above can be viewed in storage of phone numbers where we may need to have quick looks at some particular digits in an application. Using the number systems mentioned so far to achieve this would be rather unsatisfactory.

BCD (continued…) Here, instead of binary representation of the whole number, we represent each digit of the decimal number in binary code. Using this process, we can easily distinguish between decimal digits in our finally binary represented number if needed. The main problems with this system would be in the arithmetic arena which we had overlooked in the first place. We also have easier conversions in the BCD form but are using up more memory to store our numbers.

BCD (continued…) In this number system we need to be able to represent numbers from 0 through 9 for which we use 4 bit numbers from 0000 through 1001.

ASCII Code System In some application storing text is the most important of all. The ASCII code is used for this mean. The digit 0 through 9, lowercase and uppercase letters all have specific codes in this system. Today, an extended ASCII table is also used alongside the basic one which contains the codes of foreigner letters.

ASCII Code System (continued…) 8 bit codes are used to represent the ASCII codes, where the leftmost digit specifies which table a specific code belongs to. Codes starting with 1 are from the extended ASCII table and those starting with 0 belongs to the basic one. Special characters are also included in the ASCII code range. It’s also true about the control characters.

ASCII Code System (continued…) Control characters (first 2 columns) are not printable and only perform particular actions when used. For instance: BEL: The printer beeps. BS: A backspace will be made on the printer. LF: Cursor is sent to the next line. FF: Page must be ejected from the printer. CR: The cursor is sent to the beginning of the line.

ASCII Code System (continued…) The control codes used to be used much more in older systems, and nowadays they are usually recognized with a combination of “ctrl” + “the first uppercase alphabetical letter in the same row” instead of memorizing the related codes.

Overflow We shall show this concept through the following example: As can be seen above, a negative result has occurred from the addition of 2 positive numbers. This can not be an acceptable answer. The result could have been shown correctly in 9 bits, but our system has at most 8.

Overflow (continued…) Note: Overflowing can be caused by adding large negative or positive numbers. It’s clear that adding a negative number and a positive one can not cause overflow. Note: A way for pointing out an overflow occurrence is when the sign bit of the result differs from that of the operands (if the operand’s sign bits are the same).

Overflow (continued…) Diminishing overflows can be accomplished by extending the space or numbers are stored in, for example to 16 bits. Using this method in the first case shown in the latter slides can be now seen as:

Overflow (continued…) Extending the size of storage must be done with consideration of the number’s sign. This is done by the use of the “Sign-Extension Process” where the 8 left most bits (16,32,… left most bits-dependent on the size of our actual number) of our new number are filled with the actual numbers’ sign bit.

Designing an Overflow Detector The circuit we are about to design will need three inputs for it’s aim. The first and the second operands’ sign bit and also the sign bit of the sum.

Designing an Overflow Detector (continued…) The problem, we face, can be solved with the following insight to it. In words we have: “Overflow occurs when: a=0 and b=0 and s=1 or a=1 and b=1 and s=0” Changing the sentence above and closing the gap between the English statement and the math logic, we have:

Designing an Overflow Detector (continued…) If we state the equation using the following symbols, we have:

Structure of NMOS and PMOS Transistors The structure of a typical transistor is something like this: A transistor conducts when the channel between the source and drain is filled with carriers. In a NMOS transistor, the channeling is done by negative carriers (free electrons) and in PMOS transistors, it is done by positive carrier (holes electrons in the capacity band).

Designing Logical Gates Using Transistors Now we will attempt to put together combinations of these transistors to serve the needed purpose of the mentioned logical gates. The gate “NOT” (inverter):

Designing Logical Gates Using Transistors (continued…) As it can be obviously seen in the previous figure, a 0 input will make the PMOS transistor conduct and the NMOS one not conduct, resulting in a 1 output and a 1 input will have the output pulled down to 0 through the NMOS transistor.

Designing Logical Gates Using Transistors (continued…) The gate “NOR”: If either of the 2 PMOS transistor doesn’t conduct, the supply will not reach the output whereas the output will be 0 if either of the NMOS transistors conducts. This structure of transistors serves the NOR function.

Designing Logical Gates Using Transistors (continued…) The gate “NAND”: This structure can serve as NAND, the output being 0 only when the 2 inputs are 1 simultaneously.

Designing Logical Gates Using Transistors (continued…) Note: Using three input in each of the serial or parallel parts of these circuits will give the structure of a three input NAND/NOR notation.