Binary Number System & Logic Operations. The focus of the last lecture was on the microprocessor During that lecture we learnt about the function of the.

Slides:



Advertisements
Similar presentations
التصميم المنطقي Second Course
Advertisements

Lecture 3. Boolean Algebra, Logic Gates
1 Number Systems. 2 Numbers Each number system is associated with a base or radix – The decimal number system is said to be of base or radix 10 A number.
Combinational Digital Circuits. Measurement Our world is an analog world. Measurements that we make of the physical objects around us are never in discrete.
Number Systems and Arithmetic
Number Systems and Codes In PLC
CS 105 Digital Logic Design
1 Survey of Computer Science CSCI 110, Spring 2011 Lecture 16 Digital Circuits, binary Numbers.
CS231 Fundamentals1 Fundamentals What kind of data do computers work with? – Deep down inside, it’s all 1s and 0s What can you do with 1s and 0s? – Boolean.
History – 2.
1 CSC103: Introduction to Computer and Programming Lecture No 2.
In science, technology, business, and, in fact, most other fields of endeavor, we are constantly dealing with quantities. Quantities are measured, monitored,
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.
CS101 Introduction to Computing Lecture 8 Binary Numbers & Logic Operations.
Test #1 rescheduled to next Tuesday, 09/20/05 The contents will cover chapter 1, 2, and part of Chapter 4. The contents will cover chapter 1, 2, and part.
XOR and XNOR Logic Gates. XOR Function Output Y is TRUE if input A OR input B are TRUE Exclusively, else it is FALSE. Logic Symbol  Description  Truth.
Lecture 7 How computers process data (Number Systems) PRESENTED BY MD. MAHBUBUL ALAM, PHD 1.
COMPUTER SYSTEM ARCHITECTURE By Sohaib.  The digital computer is a digital system that performs various computational tasks.  The word digital implies.
Fundamentals of IT UNIT-I OnlyforIPMCA. DIGITAL SIGNALS & LOGIC GATES Signals and data are classified as analog or digital. Analog refers to something.
1 Number SystemsLecture 8. 2 BINARY (BASE 2) numbers.
CS1Q Computer Systems Lecture 8
1 Problem Solving using computers Data.. Representation & storage Representation of Numeric data The Binary System.
Logic Design Dr. Yosry A. Azzam. Binary systems Chapter 1.
Number systems: binary, decimal, hexadecimal and octal. Conversion between various number systems Number systems: binary, decimal, hexadecimal and octal.
ECE 3110: Introduction to Digital Systems Number Systems.
1 DLD Lecture 18 Recap. 2 Recap °Number System/Inter-conversion, Complements °Boolean Algebra °More Logic Functions: NAND, NOR, XOR °Minimization with.
Fall 2012: FCM 708 Foundation I Lecture 2 Prof. Shamik Sengupta
Digital Logic Design Week 3
Course contents Chapter 1 - section 1.6 Chapter 2 - all sections Chapter – 4.7, and 4.12 Chapter , Chapter 6 - all sections.
Number systems, Operations, and Codes
ECE 2110: Introduction to Digital Systems 2. Number Systems & Codes.
1 EG 32 Digital Electronics Thought for the day You learn from your mistakes..... So make as many as you can and you will eventually know everything.
How Computer Represent Data
June 10, 2002© Howard Huang1 Number systems To get started, we’ll discuss one of the fundamental concepts underlying digital computer design:
CMP 100 Introduction to Computing Lecture Binary Numbers & Logic Operations.
Codes Octal Power Hexadecimal ASCII BCD Code
1 Ethics of Computing MONT 113G, Spring 2012 Session 1 Digital Circuits, binary Numbers Course webpage:
Chapter-3: BOOLEAN ALGEBRA & LOGIC GATES Analysis and logical design.
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
CSC 3210 Computer Organization and Programming
Logic Gates and Boolean Algebra Introduction to Logic II.
Chapter 32 Binary Number System. Objectives After completing this chapter, you will be able to: –Describe the binary number system –Identify the place.
Mu.com.lec 9. Overview Gates, latches, memories and other logic components are used to design computer systems and their subsystems Good understanding.
CS231: Computer Architecture I Laxmikant Kale Fall 2002.
Programmable Logic Controller
Unit 1 Introduction Number Systems and Conversion.
DAT10403 CHAPTER 4 COMPUTER ARITHMETIC By Noordiana Kassim
Computer Code.
Octal to Decimal Decimal Octal Binary Hexadecimal.
Computer Organisation
DIGITAL LOGIC CIRCUITS
Digital Electronics INTRODUCTION ANALOG VS DIGITAL NUMBER SYSTEMS.
Introduction Molecules: made up of atoms of individual elements.
CSE 102 Introduction to Computer Engineering
Location in course textbook
2.0 COMPUTER SYSTEM 2.2 Number System and Representation
Number System conversions
Digital Signals Digital Signals have two basic states:
Basic Digital Logic Basic Gates
Fundamentals & Ethics of Information Systems IS 201
Digital Electronics Ms. Deepa Mehta.
CISC101 Reminders Your group name in onQ is your grader’s name.
13 Digital Logic Circuits.
Chapter 2 Number Systems.
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
XOR Function Logic Symbol  Description  Truth Table 
Chapter 2 Number System.
Digital and Microprocessor Technique I
Chapter 2 Number Systems.
Presentation transcript:

Binary Number System & Logic Operations

The focus of the last lecture was on the microprocessor During that lecture we learnt about the function of the central component of a computer, the microprocessor And its various sub-systems –Bus interface unit –Data & instruction cache memory –Instruction decoder –ALU –Control unit

Learning Goals for Today 1.To become familiar with number system used by the microprocessors - binary numbers 2.To become able to perform decimal-to-binary conversions 3.To understand the NOT, AND, OR and XOR logic operations – the fundamental operations that are available in all microprocessors

BINARY (BASE 2) numbers

DECIMAL (BASE 10) numbers

Decimal (base 10) number system consists of 10 symbols or digits

Decimal The numbers are represented in Units, Tens, Hundreds, Thousands; in other words as 10 power. 191=1 x x x 10 0  increasing power Th.Hund.Tens.Units

Binary (base 2) number system consists of just two 0 1

Binary On the pattern of Decimal numbers one could visualize Binary Representations:  Powers =1 x x x 2 0 =5 10

Conversion = = = 240 Decimal to Binary Binary to Decimal

Other popular number systems Octal –base = 8 –8 symbols (0,1,2,3,4,5,6,7) Hexadecimal –base = 16 –16 symbols (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)

Codes Octal  Power Hexadecimal A B C D E F

Code conversions Decimal to Octal Similar to Dec-to Binary: Start dividing by 8 and build Octal figures from Remainders: =

Code conversions Binary –to-Octal 3 bits of binary could provide weight of 8 10, that is equivalent to Octal;i.e: Bits: b2b1b0 Wts:421 Bin: 111  7 10 and Octal range 0-7 Example: = Octal Values: 4 7 2

Octal Conversion binary:Octal:   x x x 8 0

Decimal (base 10) numbers are expressed in the positional notation 4202 = 2x x x x10 3 The right-most is the least significant digit The left-most is the most significant digit

Decimal (base 10) numbers are expressed in the positional notation 4202 = 2x x x x10 3 1’s multiplier 1

Decimal (base 10) numbers are expressed in the positional notation 4202 = 2x x x x ’s multiplier 10

Decimal (base 10) numbers are expressed in the positional notation 4202 = 2x x x x ’s multiplier 100

Decimal (base 10) numbers are expressed in the positional notation 4202 = 2x x x x ’s multiplier 1000

Binary (base 2) numbers are also expressed in the positional notation = 1x x x x x2 4 The right-most is the least significant digit The left-most is the most significant digit

Binary (base 2) numbers are also expressed in the positional notation = 1x x x x x2 4 1’s multiplier 1

Binary (base 2) numbers are also expressed in the positional notation = 1x x x x x2 4 2’s multiplier 2

Binary (base 2) numbers are also expressed in the positional notation = 1x x x x x2 4 4’s multiplier 4

Binary (base 2) numbers are also expressed in the positional notation = 1x x x x x2 4 8’s multiplier 8

Binary (base 2) numbers are also expressed in the positional notation = 1x x x x x2 4 16’s multiplier 16

Counting in Decimal Counting in Binary

Why binary ? Because this system is natural for digital computers The fundamental building block of a digital computer – the switch – possesses two natural states, ON & OFF. It is natural to represent those states in a number system that has only two symbols, 1 and 0, i.e. the binary number system In some ways, the decimal number system is natural to us humans. Why?

bit binary digit

Byte = 8 bits

Decimal Binary conversion

Convert 75 to Binary remainder

Check =1x x x x x x x2 6 = =75

Convert 100 to Binary remainder

That finishes our first topic - introduction to binary numbers and their conversion to and from decimal numbers Our next topic is …

Boolean Logic Operations

Let x, y, z be Boolean variables. Boolean variables can only have binary values i.e., they can have values which are either 0 or 1 For example, if we represent the state of a light switch with a Boolean variable x, we will assign a value of 0 to x when the switch is OFF, and 1 when it is ON

A few other names for the states of these Boolean variables 01 OffOn LowHigh FalseTrue

We define the following logic operations or functions among the Boolean variables NameExampleSymbolically NOT y = NOT( x ) x´x´ AND z = x AND y x · y OR z = x OR y x + y XOR z = x XOR y x  y

We’ll define these operations with the help of truth tables what is the truth table of a logic function A truth table defines the output of a logic function for all possible inputs ?

Truth Table for the NOT Operation (y true whenever x is false) xy = x´ 0 1

Truth Table for the NOT Operation xy = x´ 01 10

Truth Table for the AND Operation (z true when both x & y true) xyz = x · y

Truth Table for the AND Operation xyz = x · y

Truth Table for the OR Operation (z true when x or y or both true) xyz = x + y

Truth Table for the OR Operation xyz = x + y

Truth Table for the XOR Operation (z true when x or y true, but not both) xy z = x  y

Truth Table for the XOR Operation xy z = x  y

Those 4 were the fundamental logic operations. Here are examples of a few more complex situations z = (x + y)´ z = y · (x + y) z = (y · x)  w STRATEGY: Divide & Conquer

xy x + y z = (x + y)´

xy x + yz = y · (x + y)

xy wy · x z = (y · x)  w

Number of rows in a truth table? 2 n n = number of input variables

What have we learnt today? 1.About the binary number system, and how it differs from the decimal system 2.Positional notation for representing binary and decimal numbers 3.A process (or algorithm) which can be used to convert decimal numbers to binary numbers 4.Basic logic operations for Boolean variables, i.e. NOT, OR, AND, XOR, NOR, NAND, XNOR 5.Construction of truth tables (How many rows?)