Number Systems with special emphasis on Binary Last lecture Spring 2016 BRAC University Dept. of EEE. 24/01/2016 Rachaen M. Huq1.

Slides:



Advertisements
Similar presentations
Computer Organization and Architecture Tutorial 6 Kenneth Lee.
Advertisements

EET 1131 Unit 7 Arithmetic Operations and Circuits
التصميم المنطقي Second Course
Relationship Between Basic Operation of Boolean and Basic Logic Gate The basic construction of a logical circuit is gates Gate is an electronic circuit.
ECEN 248: INTRODUCTION TO DIGITAL SYSTEMS DESIGN Lecture 3 Dr. Shi Dept. of Electrical and Computer Engineering.
1 COMP541 Combinational Logic Montek Singh Jan 16, 2007.
Computer ArchitectureFall 2008 © August 25, CS 447 – Computer Architecture Lecture 3 Computer Arithmetic (1)
DIGITAL SYSTEMS TCE OTHER COMBINATIONAL LOGIC CIRCUITS WEEK 7 AND WEEK 8 (LECTURE 1 OF 3) COMPARATORS CODE CONVERTERS.
Lecture 3. Boolean Algebra, Logic Gates
In this module you will learn: What the various logic gates do. How to represent logic gates on a circuit diagram. The truth tables for the logic gates.
Data Representation – Chapter 3 Sections 3-2, 3-3, 3-4.
Topic 4 Computer Mathematics and Logic
+ CS 325: CS Hardware and Software Organization and Architecture Exam 1: Study Guide.
CS 105 Digital Logic Design
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
Computers Organization & Assembly Language
Binary Codes Computers and other digital systems "work" with binary numbers. I/P & O/P is usually done using decimal numbers, alphabetics, special symbols.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
1 Modified from  Modified from 1998 Morgan Kaufmann Publishers Chapter Three: Arithmetic for Computers citation and following credit line is included:
Lecture 17: Digital Design Today’s topic –Intro to Boolean functions Reminders –HW 4 due Wednesday 10/8/2014 (extended) –HW 5 due Wednesday 10/15/2014.
Logic Design A Review. Binary numbers Binary numbers to decimal  Binary 2 decimal  Decimal 2 binary.
Digital Electronics. Introduction to Number Systems & Codes Digital & Analog systems, Numerical representation, Digital number systems, Binary to Decimal.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
Combinational Logic 1.
Course contents Chapter 1 - section 1.6 Chapter 2 - all sections Chapter – 4.7, and 4.12 Chapter , Chapter 6 - all sections.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /05/2013 Lecture 4: Basics of Logic Design Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
Sneha.  Gates Gates  Characteristics of gates Characteristics of gates  Basic Gates Basic Gates  AND Gate AND Gate  OR gate OR gate  NOT gate NOT.
Tutorial: ITI1100 Dewan Tanvir Ahmed SITE, UofO
CEC 220 Digital Circuit Design Binary Codes
CHAPTER 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs
1. Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 2.
Boolean Algebra Computer Architecture. Digital Representation Digital is an abstraction of analog voltage –Voltage is a continuous, physical unit Typically.
CEC 220 Digital Circuit Design Binary Codes Mon, Aug 31 CEC 220 Digital Circuit Design Slide 1 of 14.
ECE DIGITAL LOGIC LECTURE 5: BINARY LOGIC AND DIGITAL LOGIC GATES Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 01/28/2016.
ECE DIGITAL LOGIC LECTURE 15: COMBINATIONAL CIRCUITS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 10/20/2015.
Computer Organization 1 Data Representation Negative Integers.
President UniversityErwin SitompulDigital Systems 7/1 Lecture 7 Digital Systems Dr.-Ing. Erwin Sitompul President University
1’S COMPLEMENT REPRESENTATION 1’s complement of a number (binary) is obtained by changing all 1’s to 0 and all 0’s to 1. If one of these numbers is positive.
Computing Systems Lecture 3 Binary Representation & Boolean Logic Binary and Logic 1.
Chapter 3 Boolean Algebra and Digital Logic T103: Computer architecture, logic and information processing.
The First lesson on Digital Logic Rachaen M. Huq1 Rachaen Huq. Dept. of EEE, BRACU.
DATA REPRESENTATION IN COMPUTER MEMORY.  Describe the coding system:  Sign and magnitude  1’s Complement and 2’s Complement  Binary Coded Decimal.
ECE 2110: Introduction to Digital Systems Signed Number Conversions.
CS2100 Computer Organisation
Hoda Roodaki Boolean Algebra Hoda Roodaki
Computer Architecture & Operations I
Boolean Algebra & Logic Gates
Morgan Kaufmann Publishers
Digital Logic & Design Dr. Waseem Ikram Lecture 02.
Boolean Algebra & De Morgan's Theorems
Digital Logic & Design Dr. Waseem Ikram Lecture 05
Digital Systems Section 8 Multiplexers. Digital Systems Section 8 Multiplexers.
CHAPTER 3 SETS AND BOOLEAN ALGEBRA
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 6
Chapter 2 Bits, Data Types & Operations Integer Representation
Digital Electronics & Logic Design
Digital Logic & Design Lecture 05
Digital Logic & Design Lecture 02.
Fundamentals of Computer Systems
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Data Representation – Chapter 3
Digital Systems Design
Digital Systems Section 12 Binary Adders. Digital Systems Section 12 Binary Adders.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ECE 331 – Digital System Design
ECE 352 Digital System Fundamentals
CSE 370 – Winter Number syst.; Logic functions- 1
Presentation transcript:

Number Systems with special emphasis on Binary Last lecture Spring 2016 BRAC University Dept. of EEE. 24/01/2016 Rachaen M. Huq1

Quick Recap – Signed Numbers - 2’s complements – addition subtraction If I ask you… What would be a computer system’s in decimal? What you be your answer? Rachaen M. Huq2

Quick Recap – Signed Numbers - 2’s complements – addition subtraction If you had attended the last class, your response would be… The question does not provide “sufficient” information. Two more things need to be clarified. Rachaen M. Huq3

1)What is the bit-length of your system? (Just to make sure if you have or haven’t ignored the least significant zeros when you wrote the number. E.g. is it ? Like an 8 bit system? Or , in 6 bit system ? 2) Is the number signed or unsigned. (Most important question). Rachaen M. Huq4 Quick Recap – Signed Numbers - 2’s complements – addition subtraction

Lets say it’s a 6 bit system. That means it is , as it is. NOW: If it is unsigned The value would be __________________? Rachaen M. Huq5 Quick Recap – Signed Numbers - 2’s complements – addition subtraction

If it is signed – The MSB 1 represents it’s a negative number To get the value, need to complement again. Notice that after complementing, the MSB 1 becomes 0 For a signed number: 1 in MSB means –ve, 0 means +ve. So the value would be _____________________? Then the absolute value would be______________? Rachaen M. Huq6 Quick Recap – Signed Numbers - 2’s complements – addition subtraction

Express -7 in an 8 bit system which uses a 2’s complement mechanism to represent negative numbers Rachaen M. Huq7 Quick Recap – exercise

Finding the largest possible numbers to express at a particular length For unsigned, its more straightforward. We know it already In decimal, what is the maximum number for a 3 digit space? Rachaen M. Huq8

Finding the largest possible numbers to express at a particular length Can we generalize this? (Base ^(space) ] -1 So what would it be in binary ? Rachaen M. Huq9

Finding the largest possible numbers to express at a particular length 111 Rachaen M. Huq10 [2 ^ (3) ] -1 Makes sense? What would be the case for an 8 bit unsigned number? In other words, what is the maximum number expressed with 8 bits in an unsigned system?

Finding the largest possible numbers to express at a particular length What if the number is signed? What is the largest positive number in an 8 bit signed number system ? The number is ______________________ Remember, 0 means positive, 1 means negative. What is the value in decimal? What is the absolute value? Rachaen M. Huq11

Finding the largest possible numbers to express at a particular length BONUS +1. What is the largest negative number in an 8 bit signed number system? Hints: MSB =1 for sure. To find out the abs. value of a negative number, the representation is complemented again So you need to make sure that you are reaching the maximum absolute value when complemented. Common sense says (comparing with the unsigned cased) that it should be But should it be so? Rachaen M. Huq12

Last semester midterm question (weight 3/20) fraction of students who got it right  3/41 Consider an 8 bit adder/subtractor simple computer It takes TWO 8 bit signed numbers as inputs Gives ONE 8 bit signed number as an output. The result is the addition of the two numbers. (note that since it deals with signed numbers, addition also could mean subtraction, e.g a+(-b) = a-b What is the working range of the computer. That means, what must be the limitation of the input bit-lengths, (or How would you LIMIT the input bit-lengths) so that the output can show meaningful results. Rachaen M. Huq13

Other representation of signed numbers Sign & magnitude. Example: _____________________________ Simple, more “human-like”, but not much useful. Doesn’t help in calculations. 2’s complement also clarifies the difference between +ve and –ve numbers using only MSB but it has the additional benefit of helping in subtractions. Rachaen M. Huq14

Binary codes Useful for human-machine-interfaces, where the calculations are not primary concerns, rather One-to-One correspondence. ASCII Codes. (Table 1-5 Morris Mano ) BCD (will be used in this course a lot) Excess-3 (will be used later) See examples in black board. Rachaen M. Huq15

END OF OUR TARGET TOPICS in Number Systems… Introduction to Binary Logic / Digital Logic. Rachaen M. Huq16

Binary LOGIC, Boolean variables Rachaen M. Huq17 “A”, “B”, and “Lamp” are Binary Variables, i.e. can take values only 1 and 0 (only two states) See the table for ALL Possible combinations of A, B, and Lamp A practical example ABLamp Its called a Binary AND Logic

Representation of AND Rachaen M. Huq18 Note the symbol of an AND Logic, a.k.a. AND Gate. There are other symbols for other kind of logics. Its called a GATE because the inputs are given to the “gates” of the MOSFETS. Hence, the logic gate symbols exist in reality as a combination of MOSFETS. The inputs are either a Low, (0V or -5V) or High(5V). Low =0, High = 1. Expressed as: Output = A.B The expression is a Boolean algebraic equation, driven by Boolean variables “output”, “B” and “B”. This logical relationship table is called a truth table

Inside an AND GATE Rachaen M. Huq19 Apply 5V in Both A and B, you will get 5V in “Out” directly from Vdd biasing (5V). Any of them is 0V, the line disconnects, but below, one line is activated which makes OUT to be connected to Vss- (0V).

Practical Example of an OR Gate Rachaen M. Huq20 Expressed as: Output = A + B

NOT gate (inverter) Rachaen M. Huq21 Note that a NOT gate can have only ONE input and only ONE output Expressed as: C = A’

Summary of Basic gates Rachaen M. Huq22 AND/OR Gates may have more than two inputs… Depending one How many MOSFETS are in series/parallel! Guess the truth tables

Other gates Rachaen M. Huq23 Output = ??

Rachaen M. Huq24 NAND Negative OR Invert First Then OR ABCOut = C’ ABAB Out ABAB AA’BB’Out C

Do the same for NOR and Neg. AND You will find that they eventually lead to Boolean algebraic identities. (A+B)’ = A’. B’ (AB)’ = A’ + B’ Its called De Morgan’s Law. This is just an identity which applies in Boolean Algebra, just like the (a+b)^2 identity applies in traditional algebra. Rachaen M. Huq25

Exclusive (X-__) gates Rachaen M. Huq26 Symbol? Output = A__?__B Symbol? Output = A__?__B

A summary of all the gates are available at Section 2-7 Morris Mano Page 57 Rachaen M. Huq27