Digital logic COMP214 Lecture 1 Dr. Sarah M.Eljack Chapter 1 1 مقرر المنطق الرقمي 1. Concepts and basic components of computer hardware and software. 2. Systems numbers 3. binary Systems 4. Boolean algebra 5. Logical expressions 6. Logic gates 7. Digital circuit design Structural 8. Sequential digital circuits Chapter 1 2 References :المراجع 1. Digital Design, Mano, M. Morris, 3rd edition, ISBN 0-13-062121-8, PrenticeHall, 2002. 2. Fundamentals of logic Design, 5th edition, Brooks/Cole Thomson Learning, 2004. 3. Introduction to Digital Systems, M. Ercegovac, T. Lang, and J. Moreno, Wiley and Sons. 1998. Chapter 1 3 Outline Introduction Numbering Systems Binary & Hexadecimal Numbers Base Conversions Integer Storage Sizes Binary and Hexadecimal Addition Signed Integers and 2's Complement Notation Binary and Hexadecimal subtraction Carry and Overflow Character Storage Overview Digital Systems and Computer Systems Information Representation Number Systems [binary, octal and hexadecimal] Chapter 1 5 Digital System Takes a set of discrete information inputs and discrete internal information (system state) and generates a set of discrete information outputs. Discrete Inputs Discrete Information Processing System Discrete Outputs System State Chapter 1 6 Digital System Example: A Digital Counter (e. g., odometer): Count Up Reset 0 0 1 3 5 6 4 Inputs: Count Up, Reset Outputs: Visual Display "Value" of stored digits State: Synchronous or Asynchronous? Chapter 1 7 A Digital Computer Example Memory CPU Inputs: Keyboard, mouse, modem, microphone Control unit Datapath Input/Output Outputs: CRT, LCD, modem, speakers Synchronous or Asynchronous? Chapter 1 8 Signal An information variable represented by physical quantity. For digital systems, the variable takes on discrete values. Two level, or binary values are the most prevalent values in digital systems. Binary values are represented abstractly by: • • • • digits 0 and 1 words (symbols) False (F) and True (T) words (symbols) Low (L) and High (H) and words On and Off. Binary values are represented by values or ranges of values of physical quantities Chapter 1 9 Signal Examples Over Time Time Analog Digital Asynchronous Synchronous Continuous in value & time Discrete in value & continuous in time Discrete in value & time Chapter 1 10 Signal Example – Physical Quantity: Voltage OUTPUT INPUT 5.0 HIGH 4.0 3.0 2.0 LOW 1.0 HIGH Threshold Region LOW 0.0 Volts Chapter 1 11 Binary Values: Other Physical Quantities What are other physical quantities represent 0 and 1? • CPU Voltage • Disk Magnetic Field Direction • CD Surface Pits/Light • Dynamic RAM Electrical Charge Chapter 1 12 Introduction Computers only deal with binary data (0s and 1s), hence all data manipulated by computers must be represented in binary format. Machine instructions manipulate many different forms of data: • Numbers: Integers: 33, +128, -2827 Real numbers: 1.33, +9.55609, -6.76E12, +4.33E-03 • Alphanumeric characters (letters, numbers, signs, control characters): examples: A, a, c, 1 ,3, ", +, Ctrl, Shift, etc. • Images (still or moving): Usually represented by numbers representing the Red, Green and Blue (RGB) colors of each pixel in an image, • Sounds: Numbers representing sound amplitudes sampled at a certain rate (usually 20kHz). So in general we have two major data types that need to be represented in computers; numbers and characters. Chapter 1 13 Number Systems – Representation Positive radix, positional number systems A number with radix r is represented by a string of digits: An - 1An - 2 … A1A0 . A- 1 A- 2 … A- m + 1 A- m in which 0 Ai < r and . is the radix point. The string of digits represents the power series: ( i=n-1 (Number)r = i=0 Ai r )+( j=-1 i Aj r) j j=-m (Integer Portion) + (Fraction Portion) Chapter 1 14 . Numbering systems are characterized by their base number. In general a numbering system with a base r will have r different digits (including the 0) in its number set. These digits will range from 0 to r-1 The most widely used numbering systems are listed in the table below: Chapter 1 15 Chapter 1 16 Number Systems – Examples Radix (Base) Digits 0 1 2 3 Powers of 4 Radix 5 -1 -2 -3 -4 -5 General Decimal Binary r 10 2 0 => r - 1 0 => 9 0 => 1 r0 r1 r2 r3 r4 r5 r -1 r -2 r -3 r -4 r -5 1 10 100 1000 10,000 100,000 0.1 0.01 0.001 0.0001 0.00001 1 2 4 8 16 32 0.5 0.25 0.125 0.0625 0.03125 Chapter 1 17 Special Powers of 2 210 (1024) is Kilo, denoted "K" 220 (1,048,576) is Mega, denoted "M" 230 (1,073, 741,824)is Giga, denoted "G" Chapter 1 18 Binary Numbers 1 1 1 1 1 1 1 1 Each digit (bit) is either 1 or 0 2 2 2 2 2 2 2 Each bit represents a power of 2 Every binary number is a sum of powers of 2 7 6 5 4 3 2 1 20