SlideShare a Scribd company logo
UNIT-1
Mohammad Asif Iqbal
Assistant Professor,
Deptt of ECE,
JETGI, Barabanki
Digital Signals
• Digital Signals have two basic states:
1 (logic “high”, or H, or “on”)
0 (logic “low”, or L, or “off”)
• Digital values are in a binary format.
Binary means 2 states.
• A good example of binary is a light (only
on or off)
Binary
Base 2 = Base 10
000 = 0
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7
In Binary, there are only 0’s and 1’s. These numbers are
called “Base-2” ( Example: 0102)
We count in “Base-10”
(0 to 9)
Binary as a Voltage
• Voltages are used to represent logic values:
• A voltage present (called Vcc or Vdd) = 1
• Zero Volts or ground (called gnd or Vss) = 0
A simple switch can provide a logic high or a logic low.
A Simple Switch
• Here is a simple switch used to provide a logic value:
Vcc
Gnd, or 0
Vcc
Vcc, or 1
There are other ways to connect a switch.
• Converting to decimal from binary:
– Evaluate the power series
• Example
1 0 1 1 1 12
5 4 3 02 1
0*241*25 + 1*23 ++ 1*22 +
1*21 + 1*20 = 4710
Number systems
• Convert to decimal from binary:
– 1011011
a. 27
b. 91
c. 109
d. -109
e. 551
Number systems
Memorize the first ten powers of two
Review of Number systems
Copyright © 2008 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Review of Number systems
• Converting to binary from decimal:
– Divide the decimal number by 2 repeatedly.
– The remainder gives the digits of the binary number
7462
2
2
2
2
2
2
2
2
373 R 0
186 R 1
93 R 0
46 R 1
23 R 0
11 R 1
5 R 1
2
2 R 1
1 R 0
Number systems
10111010102
• Convert to binary from decimal:
–65
a.110101
b.101110
c.100001
d.100000
e.1000001
Number systems
• Shorthand for binary
• Binary digits are grouped into 4
– Start at the least significant
– If number of digits is not a multiple of 4, add zeros
• Each group is interpreted in decimal
• Digits above 9 are represented by the first six letter of the alphabet:
– 10: A; 11: B; 12: C; 13: D; 14: E; 15: F
• Example:
10111010102 = 0010 1110 10102
= 2EA16
Hexadecimals – Base 16
• Convert to hexadecimal from binary:
–1111111
a.771
b.177
c.F7
d.7F
e.127
Number systems
• Converting to decimal from hex:
– Evaluate the power series
• Example
2 E A 16
02 1
14*161
2*162 + 10*160+
= 74610
Hexadecimals – Base 16
• Convert to decimal from hexadecimal:
–65
a.65
b.101
c.86
d.100001
e.41
Number systems
• Same steps as for conversion as binary and hexadecimal and any other
base
• Converting to octal from decimal:
– Divide the decimal number by 8 repeatedly.
– The remainder gives the digits of the binary number
• Example: Convert 15310 to base 8.
Octal – Base 8
• Convert to octal from decimal:
15
a.71
b.177
c.F7
d.17
e.27
Number systems
• Converting to decimal from hex:
– Evaluate the power series
• Example
2 0 7 8
02 1
0*81
2*82 + 7*160+
= 13510
Octal – Base 16
Binary Addition
• Add one digit at a time
• Obtain a sum and a carry
• Similar to decimal addition – but pay attention to the
base
Binary Addition
• Add the following binary number
• 10011+11111
a. 110010
b. 001100
c. 101110
d. 021120
e. 010011
Copyright © 2008 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Binary Addition
Copyright © 2008 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Binary Addition
Signed Numbers
• Signed numbers are mostly stored in two’s complements form
• Leading bit is 0 for positive numbers and 1 for negative
• For n bits, the range of numbers that can be stored is:
• -2n-1: 2n-1-1
• To derive the binary negative (two’s complement) of a number:
• Determine the magnitude (how many bits)
• Find the binary equivalent of the magnitude
• Complement each bit
• Add 1
Signed Numbers
• Example:
• Derive the 6-bit binary negative (two’s complement) of 17
• Determine the magnitude (how many bits)
• 6bits
• Find the binary equivalent of the magnitude
• 010001
• Complement each bit
• 101110
• Add 1
• 101111
Copyright © 2008 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Signed Numbers
• Derive the 5-bit binary negative (two’s
complement) of 17
a. 0101111
b. 101111
c. 10000
d. 01111
e. 01110
Overflow
• This occurs when the sum is out of range
• Example: for 4-bit numbers, the range is [- 8:7]
• Find the sum of +4 and +5
• Find the sum of -4 and -5
• Addition of two numbers of the opposite sign never produces
overflow
• Adding two same-signed numbers and obtaining a result of the
opposite sign indicates overflow
Overflow
• For each of the following problems, enter A if the result is an
overflow and B if it’s not. Assume the number of bits is 6
1. 15 + 17
2. -15 + 17
3. -15 -17
4. 2 - 3
Binary Subtraction
• Take the two complement of the second operand
• Then add
• For signed numbers:
• Ignore the carry-out of the higher order
• If two numbers of the same sign are added, and a result of the opposite sign
is obtained, there’s an overflow
• Ex: 7 – 5; -7 – 5
• For Unsigned number
• A carry-out of zero in the higher-order bit indicates overflow
• Ex: 5 - 7
Binary Subtraction
• What is the 5-bit binary representation of 8 -
15
a. 10111
b. 11000
c. 01001
d. 11001
e. overflow
Fractions
• Converting fractions to decimal from binary:
• Example
. 1 0 1 2
0*2-21*2-1 + 1*2-3+
= .62510
...3
1
2
1
1
1





  rarara
Fractions
• Convert .01112 to decimal
a. .875
b. .375
c. .4375
d. .0700
e. 4.375
• Converting to binary from decimal:
– Multiply the decimal number by 2 repeatedly.
– Use the integer part as the next digit each time, and then discard the
integer
– When the fraction part is zero, we have an exact conversion
– Add trailing zeroes to obtain the desired size
– For some fractions, we never get an exact conversion because the
fraction parts repeats, example: .3
.1.625*2 = 1.25
.25*2 = 0.50 .10
.101.5*2 = 1.00
Fractions
Examples
• Convert the following to base 2 : .7510
a. .111000
b. .000011
c. .110000
d. .111111
e. .101000
• Covert the integer and the fraction separately
• Example:
– 5.75 = 101.11
Mixed Numbers
Examples
• Convert the following to base 10 : 11.011002
a. 3.7500
b. 3.0300
c. 3.1875
d. 3.0300
e. 3.3750
• Computer storage
– The standard notation (IEEE Standard 754) for 32 bit numbers is:
• A sign bit: 1 for negative and 0 for positive
• An 8-bit exponent
– Stored as the binary version of 127+exponent
– Can store -126:127 as 1:254
• 23 bits for the significant digits
• The first significant digit is always a binary 1 so this is not stored
• Example: -27.875
• 27.875 = 11011.111 = 1.1011111*24
One sign bit – 1 if –ve, 0 otherwise
8 exponent bits 32 bits for significant digits
1 1000011 10111110000000000000000
Mixed Numbers
Computer Storage
• How would the number 2.1 be stored in
IEEE Standard 754 for 32 bit numbers
a. 1 10000001 01100110011001100110000
b. 0 10000000 00001100110011001100110
c. 0 00000001 10000110011001100110011
d. 1 10000000 10000000000000000000000
e. Can’t be stored
Logic Gates
• Basic Digital logic is based on 3 primary functions
(the basic gates):
• AND
• OR
• NOT
The AND function
• The AND function:
• If all the inputs are high is the output is high
• If any input is low, the output is low
• “If this input AND this input are high, the
output is high”
AND Logic Symbol
Inputs
Output
If both inputs are 1, the output is 1
If any input is 0, the output is 0
AND Logic Symbol
Inputs
Output
Determine the output
0
0
0
AND Logic Symbol
Inputs Output
Determine the output
0
1
0
AND Logic Symbol
Inputs
Output
Determine the output
1
1
1
AND Truth Table
• To help understand the function of a digital device, a
Truth Table is used:
Input Output
0 0 0
0 1 0
1 0 0
1 1 1
AND Function
Every possible input
combination
AND Gates
• It is possible to have AND gates with more than
2 inputs. The same logic rules apply – “if any
input…”
The OR function
• The OR function:
• if any input is high, the output is high
• if all inputs are low, the output is low
• “If this input OR this input is high, the
output is high”
OR Logic Symbol
Inputs
Output
If any input is 1, the output is 1
If all inputs are 0, the output is 0
OR Logic Symbol
Inputs
Output
Determine the output
0
0
0
OR Logic Symbol
Inputs
Output
Determine the output
0
1
1
OR Logic Symbol
Inputs
Output
Determine the output
1
1
1
OR Truth Table
• Truth Table
Input Output
0 0 0
0 1 1
1 0 1
1 1 1
OR Function
The NOT function
• The NOT function:
• If any input is high, the output is low
• If any input is low, the output is high
• “The output is the opposite state of the input”
• The NOT function is often called INVERTER
NOT Logic Symbol
Input
Output
If the input is 1, the output is 0
If the input is 0, the output is 1
NOT Logic Symbol
Input
Output
Determine the output
0 1
NOT Logic Symbol
Input
Output
Determine the output
1 0
OR (written as +)1
a + b (read a OR b) is 1 if and only if a = 1 or b = 1 or both
AND (written as  or simply two variables catenated)
a  b = ab (read a AND b) is 1 if and only if a = 1 and b = 1.
NOT (written)
a (read NOT a) is 1 if and only if a = 0
Summary
THANK YOU!

More Related Content

PPTX
Combinational Logic Unit 2
PDF
Chapter 01 Basic Principles of Digital Systems
PDF
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
PPT
Combinational circuits r011
PPTX
Basic electronics
PDF
Ee 202 chapter 1 number and code system
PPSX
Number system logic gates
PPT
Digital 1 8
Combinational Logic Unit 2
Chapter 01 Basic Principles of Digital Systems
Chapter 07 Digital Alrithmetic and Arithmetic Circuits
Combinational circuits r011
Basic electronics
Ee 202 chapter 1 number and code system
Number system logic gates
Digital 1 8

What's hot (20)

PPT
LOGIC GATES - SARTHAK YADAV
PPTX
Mux decod pld2_vs2
PPTX
Parallel adders
PDF
Signed Binary Numbers
PPT
Digital logic design part1
PPT
Digital Logic & Design
PPT
Digital Logic circuit
PPTX
IS 151 Lecture 8
PPT
Number system and codes
PDF
Logic Design
PPT
Counit2
PPTX
Encoders
PDF
chapter one && two.pdf
PPTX
number system
PDF
Objective Questions Digital Electronics
PPTX
Decoders
PPT
07Decoders121
PDF
Chapter 1 digital systems and binary numbers
LOGIC GATES - SARTHAK YADAV
Mux decod pld2_vs2
Parallel adders
Signed Binary Numbers
Digital logic design part1
Digital Logic & Design
Digital Logic circuit
IS 151 Lecture 8
Number system and codes
Logic Design
Counit2
Encoders
chapter one && two.pdf
number system
Objective Questions Digital Electronics
Decoders
07Decoders121
Chapter 1 digital systems and binary numbers
Ad

Similar to Unit-1 Digital Design and Binary Numbers: (20)

PPT
Module 4
PPT
Chapter 02 Data Types
PPT
Number Systems.ppt
PPT
Number_System and Boolean Algebra in Digital System Design
PPT
digital logic design number system
PPTX
Eln PPT module on electrical and electronics
PPT
BEEE - Part B - Unit 3 PPT.ppt DL&CO - Unit 1 PPT.ppt
PPTX
DLD-Introduction.pptx
PPT
Number Systems.ppt
PDF
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
PPT
Chapter 1 Digital Systems and Binary Numbers.ppt
PPTX
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
PPT
digital systems and information
PPT
Number_Systems_and_Boolean_Algebra.ppt
PPT
Digital Logic Design Lecture Notes 1.ppt
PDF
1.Digital Logic Design (Chap 01, Topic 1,2 - Binary Systems).pdf
PPTX
BEEE - Part B - Unit 3 - Digital Electronics PPT.pptx
PPT
100_2_digitalSystem_Chap1 (2).ppt
PPT
BEEE - Part B - Unit 3 PPT BEEE - Part B - Unit 3 PPT.ppt
PPTX
Fundamentals of Digital Design_Class_21st May - Copy.pptx
Module 4
Chapter 02 Data Types
Number Systems.ppt
Number_System and Boolean Algebra in Digital System Design
digital logic design number system
Eln PPT module on electrical and electronics
BEEE - Part B - Unit 3 PPT.ppt DL&CO - Unit 1 PPT.ppt
DLD-Introduction.pptx
Number Systems.ppt
Digital electronics & microprocessor Batu- s y computer engineering- arvind p...
Chapter 1 Digital Systems and Binary Numbers.ppt
chapter1digitalsystemsandbinarynumbers-151021072016-lva1-app6891.pptx
digital systems and information
Number_Systems_and_Boolean_Algebra.ppt
Digital Logic Design Lecture Notes 1.ppt
1.Digital Logic Design (Chap 01, Topic 1,2 - Binary Systems).pdf
BEEE - Part B - Unit 3 - Digital Electronics PPT.pptx
100_2_digitalSystem_Chap1 (2).ppt
BEEE - Part B - Unit 3 PPT BEEE - Part B - Unit 3 PPT.ppt
Fundamentals of Digital Design_Class_21st May - Copy.pptx
Ad

More from Asif Iqbal (20)

PPTX
IOT WITH NODEMCU13231244425435465645.pptx
PPT
RaspberryPI PPT WITH ALL THE DETAILS OF PROGRAMMING
PPTX
first day presentation related to iot.pptx
PDF
5415Microprocessor-Lecture-11.pdf
PPT
11815939.ppt
PPTX
Chandrayaan 3.pptx
PPTX
Memory unit 6
PPTX
instruction
PPTX
OPTICAL COMMUNICATION Unit 5
PPTX
OPTICAL COMMUNICATION Unit 4
PPTX
optical communication Unit 3
PPTX
OPTICAL COMMUNICATION Unit 2
PPTX
OPTICAL FIBER COMMUNICATION UNIT-1
PPTX
Synchronous Sequential Logic Unit 4
PPTX
voltage regulater
PPTX
special diode
PPTX
oscillator unit 3
PPTX
Nunit 2 feedback
PPTX
digital to analog (DAC) & analog to digital converter (ADC)
PPTX
opamp application, Bistable, astable and monostable multivibrator, IC-555 timer
IOT WITH NODEMCU13231244425435465645.pptx
RaspberryPI PPT WITH ALL THE DETAILS OF PROGRAMMING
first day presentation related to iot.pptx
5415Microprocessor-Lecture-11.pdf
11815939.ppt
Chandrayaan 3.pptx
Memory unit 6
instruction
OPTICAL COMMUNICATION Unit 5
OPTICAL COMMUNICATION Unit 4
optical communication Unit 3
OPTICAL COMMUNICATION Unit 2
OPTICAL FIBER COMMUNICATION UNIT-1
Synchronous Sequential Logic Unit 4
voltage regulater
special diode
oscillator unit 3
Nunit 2 feedback
digital to analog (DAC) & analog to digital converter (ADC)
opamp application, Bistable, astable and monostable multivibrator, IC-555 timer

Recently uploaded (20)

PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Welding lecture in detail for understanding
PPTX
Geodesy 1.pptx...............................................
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
OOP with Java - Java Introduction (Basics)
PPTX
Sustainable Sites - Green Building Construction
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
DOCX
573137875-Attendance-Management-System-original
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
web development for engineering and engineering
PDF
Digital Logic Computer Design lecture notes
bas. eng. economics group 4 presentation 1.pptx
Lecture Notes Electrical Wiring System Components
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Welding lecture in detail for understanding
Geodesy 1.pptx...............................................
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Internet of Things (IOT) - A guide to understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems
Foundation to blockchain - A guide to Blockchain Tech
OOP with Java - Java Introduction (Basics)
Sustainable Sites - Green Building Construction
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
573137875-Attendance-Management-System-original
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
UNIT 4 Total Quality Management .pptx
web development for engineering and engineering
Digital Logic Computer Design lecture notes

Unit-1 Digital Design and Binary Numbers:

  • 1. UNIT-1 Mohammad Asif Iqbal Assistant Professor, Deptt of ECE, JETGI, Barabanki
  • 2. Digital Signals • Digital Signals have two basic states: 1 (logic “high”, or H, or “on”) 0 (logic “low”, or L, or “off”) • Digital values are in a binary format. Binary means 2 states. • A good example of binary is a light (only on or off)
  • 3. Binary Base 2 = Base 10 000 = 0 001 = 1 010 = 2 011 = 3 100 = 4 101 = 5 110 = 6 111 = 7 In Binary, there are only 0’s and 1’s. These numbers are called “Base-2” ( Example: 0102) We count in “Base-10” (0 to 9)
  • 4. Binary as a Voltage • Voltages are used to represent logic values: • A voltage present (called Vcc or Vdd) = 1 • Zero Volts or ground (called gnd or Vss) = 0 A simple switch can provide a logic high or a logic low.
  • 5. A Simple Switch • Here is a simple switch used to provide a logic value: Vcc Gnd, or 0 Vcc Vcc, or 1 There are other ways to connect a switch.
  • 6. • Converting to decimal from binary: – Evaluate the power series • Example 1 0 1 1 1 12 5 4 3 02 1 0*241*25 + 1*23 ++ 1*22 + 1*21 + 1*20 = 4710 Number systems
  • 7. • Convert to decimal from binary: – 1011011 a. 27 b. 91 c. 109 d. -109 e. 551 Number systems
  • 8. Memorize the first ten powers of two Review of Number systems
  • 9. Copyright © 2008 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Review of Number systems
  • 10. • Converting to binary from decimal: – Divide the decimal number by 2 repeatedly. – The remainder gives the digits of the binary number 7462 2 2 2 2 2 2 2 2 373 R 0 186 R 1 93 R 0 46 R 1 23 R 0 11 R 1 5 R 1 2 2 R 1 1 R 0 Number systems 10111010102
  • 11. • Convert to binary from decimal: –65 a.110101 b.101110 c.100001 d.100000 e.1000001 Number systems
  • 12. • Shorthand for binary • Binary digits are grouped into 4 – Start at the least significant – If number of digits is not a multiple of 4, add zeros • Each group is interpreted in decimal • Digits above 9 are represented by the first six letter of the alphabet: – 10: A; 11: B; 12: C; 13: D; 14: E; 15: F • Example: 10111010102 = 0010 1110 10102 = 2EA16 Hexadecimals – Base 16
  • 13. • Convert to hexadecimal from binary: –1111111 a.771 b.177 c.F7 d.7F e.127 Number systems
  • 14. • Converting to decimal from hex: – Evaluate the power series • Example 2 E A 16 02 1 14*161 2*162 + 10*160+ = 74610 Hexadecimals – Base 16
  • 15. • Convert to decimal from hexadecimal: –65 a.65 b.101 c.86 d.100001 e.41 Number systems
  • 16. • Same steps as for conversion as binary and hexadecimal and any other base • Converting to octal from decimal: – Divide the decimal number by 8 repeatedly. – The remainder gives the digits of the binary number • Example: Convert 15310 to base 8. Octal – Base 8
  • 17. • Convert to octal from decimal: 15 a.71 b.177 c.F7 d.17 e.27 Number systems
  • 18. • Converting to decimal from hex: – Evaluate the power series • Example 2 0 7 8 02 1 0*81 2*82 + 7*160+ = 13510 Octal – Base 16
  • 19. Binary Addition • Add one digit at a time • Obtain a sum and a carry • Similar to decimal addition – but pay attention to the base
  • 20. Binary Addition • Add the following binary number • 10011+11111 a. 110010 b. 001100 c. 101110 d. 021120 e. 010011
  • 21. Copyright © 2008 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Binary Addition
  • 22. Copyright © 2008 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Binary Addition
  • 23. Signed Numbers • Signed numbers are mostly stored in two’s complements form • Leading bit is 0 for positive numbers and 1 for negative • For n bits, the range of numbers that can be stored is: • -2n-1: 2n-1-1 • To derive the binary negative (two’s complement) of a number: • Determine the magnitude (how many bits) • Find the binary equivalent of the magnitude • Complement each bit • Add 1
  • 24. Signed Numbers • Example: • Derive the 6-bit binary negative (two’s complement) of 17 • Determine the magnitude (how many bits) • 6bits • Find the binary equivalent of the magnitude • 010001 • Complement each bit • 101110 • Add 1 • 101111
  • 25. Copyright © 2008 The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
  • 26. Signed Numbers • Derive the 5-bit binary negative (two’s complement) of 17 a. 0101111 b. 101111 c. 10000 d. 01111 e. 01110
  • 27. Overflow • This occurs when the sum is out of range • Example: for 4-bit numbers, the range is [- 8:7] • Find the sum of +4 and +5 • Find the sum of -4 and -5 • Addition of two numbers of the opposite sign never produces overflow • Adding two same-signed numbers and obtaining a result of the opposite sign indicates overflow
  • 28. Overflow • For each of the following problems, enter A if the result is an overflow and B if it’s not. Assume the number of bits is 6 1. 15 + 17 2. -15 + 17 3. -15 -17 4. 2 - 3
  • 29. Binary Subtraction • Take the two complement of the second operand • Then add • For signed numbers: • Ignore the carry-out of the higher order • If two numbers of the same sign are added, and a result of the opposite sign is obtained, there’s an overflow • Ex: 7 – 5; -7 – 5 • For Unsigned number • A carry-out of zero in the higher-order bit indicates overflow • Ex: 5 - 7
  • 30. Binary Subtraction • What is the 5-bit binary representation of 8 - 15 a. 10111 b. 11000 c. 01001 d. 11001 e. overflow
  • 31. Fractions • Converting fractions to decimal from binary: • Example . 1 0 1 2 0*2-21*2-1 + 1*2-3+ = .62510 ...3 1 2 1 1 1        rarara
  • 32. Fractions • Convert .01112 to decimal a. .875 b. .375 c. .4375 d. .0700 e. 4.375
  • 33. • Converting to binary from decimal: – Multiply the decimal number by 2 repeatedly. – Use the integer part as the next digit each time, and then discard the integer – When the fraction part is zero, we have an exact conversion – Add trailing zeroes to obtain the desired size – For some fractions, we never get an exact conversion because the fraction parts repeats, example: .3 .1.625*2 = 1.25 .25*2 = 0.50 .10 .101.5*2 = 1.00 Fractions
  • 34. Examples • Convert the following to base 2 : .7510 a. .111000 b. .000011 c. .110000 d. .111111 e. .101000
  • 35. • Covert the integer and the fraction separately • Example: – 5.75 = 101.11 Mixed Numbers
  • 36. Examples • Convert the following to base 10 : 11.011002 a. 3.7500 b. 3.0300 c. 3.1875 d. 3.0300 e. 3.3750
  • 37. • Computer storage – The standard notation (IEEE Standard 754) for 32 bit numbers is: • A sign bit: 1 for negative and 0 for positive • An 8-bit exponent – Stored as the binary version of 127+exponent – Can store -126:127 as 1:254 • 23 bits for the significant digits • The first significant digit is always a binary 1 so this is not stored • Example: -27.875 • 27.875 = 11011.111 = 1.1011111*24 One sign bit – 1 if –ve, 0 otherwise 8 exponent bits 32 bits for significant digits 1 1000011 10111110000000000000000 Mixed Numbers
  • 38. Computer Storage • How would the number 2.1 be stored in IEEE Standard 754 for 32 bit numbers a. 1 10000001 01100110011001100110000 b. 0 10000000 00001100110011001100110 c. 0 00000001 10000110011001100110011 d. 1 10000000 10000000000000000000000 e. Can’t be stored
  • 39. Logic Gates • Basic Digital logic is based on 3 primary functions (the basic gates): • AND • OR • NOT
  • 40. The AND function • The AND function: • If all the inputs are high is the output is high • If any input is low, the output is low • “If this input AND this input are high, the output is high”
  • 41. AND Logic Symbol Inputs Output If both inputs are 1, the output is 1 If any input is 0, the output is 0
  • 43. AND Logic Symbol Inputs Output Determine the output 0 1 0
  • 45. AND Truth Table • To help understand the function of a digital device, a Truth Table is used: Input Output 0 0 0 0 1 0 1 0 0 1 1 1 AND Function Every possible input combination
  • 46. AND Gates • It is possible to have AND gates with more than 2 inputs. The same logic rules apply – “if any input…”
  • 47. The OR function • The OR function: • if any input is high, the output is high • if all inputs are low, the output is low • “If this input OR this input is high, the output is high”
  • 48. OR Logic Symbol Inputs Output If any input is 1, the output is 1 If all inputs are 0, the output is 0
  • 52. OR Truth Table • Truth Table Input Output 0 0 0 0 1 1 1 0 1 1 1 1 OR Function
  • 53. The NOT function • The NOT function: • If any input is high, the output is low • If any input is low, the output is high • “The output is the opposite state of the input” • The NOT function is often called INVERTER
  • 54. NOT Logic Symbol Input Output If the input is 1, the output is 0 If the input is 0, the output is 1
  • 57. OR (written as +)1 a + b (read a OR b) is 1 if and only if a = 1 or b = 1 or both AND (written as  or simply two variables catenated) a  b = ab (read a AND b) is 1 if and only if a = 1 and b = 1. NOT (written) a (read NOT a) is 1 if and only if a = 0 Summary