SlideShare a Scribd company logo
1 of 64
Download to read offline
14-Jan-16
Dr.AtifShahzad
1
DR ATIF SHAHZAD
Fundamentals of
Computer Systems
IE-321
LECTURE #02
9/27/2018 2
Dr.AtifShahzad
RECAP
Page 1
Course Objectives
Rules & regulations
Grading scheme
Teaching Methodology
An overview of topics
Logic examples
A simple Logic thinking process
9/27/2018 3
Dr.AtifShahzad
TODAY’S LECTURE
Digital System
What is a Numbering System?
Commonly Occurring Bases
Numbering System Examples
Base Conversion Procedure
Base Conversion
Number of Bits Required
Number of Elements represented
BCD, GRAY, ASCII & UNICODE
Q&A
14/01/2016
Dr.AtifShahzad
4
Fundamentals of
Computer Systems
Numbering Systems
LECTURE #02
14/01/2016
14/01/2016
Dr.AtifShahzad
5
Robert Noyce, 1927 - 1990
• Nicknamed“Mayor of Silicon Valley”
• Cofounded Fairchild Semiconductor in 1957
• Cofounded Intel in 1968
• Co-invented the integrated circuit
Logic Automatisms by Dr. Atif Shahzad9/27/2018 5
14/01/2016
Dr.AtifShahzad
6
Gordon Moore, 1929 -
• Cofounded Intel in 1968 with Robert Noyce.
• Moore’s Law:the number of transistors on
a computer chip doubles every year (observed
in 1965)
• Since 1975,transistor counts have doubled
every two years.
Logic Automatisms by Dr. Atif Shahzad9/27/2018 6
14/01/2016
Dr.AtifShahzad
7
DigitalValues
Discrete set of values
Logic Automatisms by Dr. Atif Shahzad9/27/2018 7
9/27/2018 8
Dr.AtifShahzad
Digital System
Takes a set of discrete informationinputs and discrete
internal information (system state) and generates a
set of discrete information outputs.
14/01/2016 8
System State
Discrete
Information
Processing
System
Discrete
Inputs
Discrete
Outputs
9/27/2018 9
Dr.AtifShahzad
Types of Digital Systems
14/01/2016 9
No state
present
Combination
al
Logic System
Output =
Function
(Input)
State present
State updated at
discrete times
=>
Synchronous
Sequential
System
State updated
at any time
=>
Asynchronous
Sequential
System
State =
Function
(State,
Input)
Output =
Function
(State)
or Function
(State,
Input)
9/27/2018 10
Dr.AtifShahzad
Digital Systems
TwoVoltage Levels
Two States
• On/Off
• Black/White
• Hot/Cold
• Stationary/Moving
Logic Automatisms by Dr. Atif Shahzad9/27/201810
9/27/2018 11
Dr.AtifShahzad
Digital System Example:
14/01/2016
11
A Digital Counter (e.g.,odometer):
1 30 0 5 6 4
Count Up
Reset
Inputs: Count Up,Reset
Outputs: Visual Display
State: "Value" of stored digits
9/27/2018 12
Dr.AtifShahzad
A Digital Computer Example
14/01/2016
12
Synchronous or
Asynchronous?
Inputs:
Keyboard,
mouse, modem,
microphone
Outputs: CRT,
LCD, modem,
speakers
Memory
Control
unit Datapath
Input/Output
CPU
9/27/2018 13
Dr.AtifShahzad
Digital Systems and Computer
Systems
9/27/201813Logic Automatisms by Dr. Atif Shahzad
9/27/2018 14
Dr.AtifShahzad
Signal
An information variable
represented by physical quantity.
For digital systems, the variable
takes on discrete values.
14/01/2016 14
9/27/2018 15
Dr.AtifShahzad
Signal
Two level, or binary values are the most prevalent values in digital systems.
Binary values are
represented by values or
ranges of values of physical
quantities
Binaryvaluesare
representedabstractlyby:
digits 0 and 1
words (symbols)
False (F) andTrue (T)
words (symbols)
Low (L) and High (H)
words
On and Off.
9/27/2018 16
Dr.AtifShahzad
Signal Examples OverTime
14/01/2016
16
Analog
Asynchronous
Synchronous
Time
Continuous in
value & time
Discrete in
value &
continuous in
time
Discrete in
value & time
Digital
9/27/2018 17
Dr.AtifShahzad
5.0
4.0
3.0
2.0
1.0
0.0
Volts
HIGH
LOW
HIGH
LOW
OUTPUT INPUT
Signal Example – Physical Quantity:
Voltage
14/01/2016 17
Threshold Region
9/27/2018 18
Dr.AtifShahzad
BinaryValues: Other Physical
Quantities
CPU:Voltage
Disk: Magnetic Field Direction
CD: Surface Pits/Light
Dynamic RAM: Electrical Charge
14/01/2016 18
What do other
physical quantities
represent 0 and 1?
9/27/2018 19
Dr.AtifShahzad
Information Representation
9/27/201819Logic Automatisms by Dr. Atif Shahzad
9/27/2018 20
Dr.AtifShahzad
Number Systems [binary, octal
and hexadecimal]
9/27/201820Logic Automatisms by Dr. Atif Shahzad
9/27/2018 21
Dr.AtifShahzad
Number Systems –
Representation
in positional number systems
Radix
is represented by a string of digits:
dn – 1dn - 2 … d1d0 . d- 1 d- 2 … d- m + 1 d- m
in which 0 ∈ Ai < r and . is the radix point.
A number
with radix r
represents the power series:
The string
of digits
14/01/2016 21
𝑑𝑑𝑛𝑛−1 … 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0 = �
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 10𝑖𝑖
9/27/2018 22
Dr.AtifShahzad
Number Systems – Examples
14/01/2016 22
123 = 1 × 102
+ 2 × 101
+3 × 100
�
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 10𝑖𝑖
9/27/2018 23
Dr.AtifShahzad
Number Systems – Questions
14/01/2016 23
78 =
947=
301=
1294
10101010=
123456=
98123=
�
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 10𝑖𝑖
9/27/2018 24
Dr.AtifShahzad
Number Systems – Examples
14/01/2016 24
General Decimal Binary
Radix (Base) r 10 2
Digits 0 => r - 1 0 => 9 0 => 1
0
1
2
3
Powers of 4
Radix 5
-1
-2
-3
-4
-5
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
9/27/2018 25
Dr.AtifShahzad
Binary Number
representation
14/01/2016 25
�
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 2𝑖𝑖
(𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)2 = �
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 2𝑖𝑖
9/27/2018 26
Dr.AtifShahzad
Binary Number
representation- EXAMPLE
14/01/2016 26
�
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 2𝑖𝑖
(𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)2 = �
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 2𝑖𝑖
11012 = 1 × 23
+1 × 22
+ 0 × 21
+1 × 20
9/27/2018 27
Dr.AtifShahzad
Binary Number
representation- EXAMPLE
14/01/2016 27
The digits of the binary number are called bits
MSB=Most Significant Bit
LSB=Least Significant Bit
(𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)2 = �
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 2𝑖𝑖
11012 = 1 × 23
+ 1 × 22
+ 0 × 21
+ 1 × 20
Group of 8 bits = 1 Byte
9/27/2018 28
Dr.AtifShahzad
Representation of a Binary
Number-Example
14/01/2016 28
MSB Binary Digit LSB
28 27 26 25 24 23 22 21 20
256 128 64 32 16 8 4 2 1
9/27/2018 29
Dr.AtifShahzad
Binary Number Names &
Prefixes
Number of Binary
Digits (bits)
Common Name
1 Bit
4 Nibble
8 Byte
16 Word
32 DoubleWord
64 QuadWord
14/01/2016 29
9/27/2018 30
Dr.AtifShahzad
Special Powers of 2
14/01/2016
30
210 (1024) is Kilo,denoted "K"
220 (1,048,576) is Mega,denoted "M"
230 (1,073,741,824) is Giga,denoted "G"
9/27/2018 31
Dr.AtifShahzad
Positive Powers of 2
Useful for Base Conversion
14/01/2016 31
Exponent Value Exponent Value
0 1 11 2,048
1 2 12 4,096
2 4 13 8,192
3 8 14 16,384
4 16 15 32,768
5 32 16 65,536
6 64 17 131,072
7 128 18 262,144
19 524,288
20 1,048,576
21 2,097,152
8 256
9 512
10 1024
9/27/2018 32
Dr.AtifShahzad
Positive Powers of 2
Useful for Base Conversion
14/01/2016 32
Exponent Value Exponent Value
0 1 11 2,048
1 2 12 4,096
2 4 13 8,192
3 8 14 16,384
4 16 15 32,768
5 32 16 65,536
6 64 17 131,072
7 128 18 262,144
19 524,288
20 1,048,576
21 2,097,152
8 256
9 512
10 1024
9/27/2018 33
Dr.AtifShahzad
In general…
14/01/2016 33
(𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)2 = �
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 2𝑖𝑖
(𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)10 = �
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 10𝑖𝑖
(𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)𝑏𝑏 = �
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 𝑏𝑏𝑖𝑖
9/27/2018 34
Dr.AtifShahzad
Binary Number Systems –
Questions
14/01/2016 34
10001 =
101010=
1100=
10000000=
100000101=
101010101010110=
1111110=
�
𝑖𝑖=𝑛𝑛−1
0
𝑑𝑑𝑖𝑖. 2𝑖𝑖
9/27/2018 35
Dr.AtifShahzad
Usage of Number systems
Name Description
Binary Computers
Octal Occasionally in Computing
Decimal Everywhere
Duodecimal
(dozenal)
Quantities like dozens
Hexadecimal Used in Computing
Vigesimal Traditional in some cultures
Sexagesimal Cirular coordinate system
(Angle and time)
Radix
2
8
10
12
16
20
60
9/27/2018 36
Dr.AtifShahzad
Commonly Occurring Bases
14/01/2016
36
Name Base Digits
Binary 2 0,1
Octal 8 0,1,2,3,4,5,6,7
Decimal 10 0,1,2,3,4,5,6,7,8,9
Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
The six letters (in addition to the 10 integers) in hexadecimal
represent: 10,11,12,13,14,15
9/27/2018 37
Dr.AtifShahzad
Decimal
(Base 10)
Binary
(Base 2)
Octal
(Base 8)
Hexadecimal
(Base 16)
00 00000 00 00
01 00001 01 01
02 00010 02 02
03 00011 03 03
04 00100 04 04
05 00101 05 05
06 00110 06 06
07 00111 07 07
08 01000 10 08
09 01001 11 09
10 01010 12 0A
11 01011 13 0B
12 01100 14 0C
13 01101 15 0D
14 01110 16 0E
15 01111 17 0F
16 10000 20 10
Numbers in Different Bases
Good idea to memorize!
14/01/2016 37
9/27/2018 38
Dr.AtifShahzad
Base Conversion
How to convert from one base system to other ?
Any Idea?
14/01/2016 38
9/27/2018 39
Dr.AtifShahzad
Converting Decimal to Binary
Successively divide the decimal number by 2
Record the remainders after each division
The remainders written in reverse order form the binary number
14/01/2016 39
Example:Convert 12310 to N2
123/2 1
61/2 1
30/2 0
15/2 1
7/2 1
3/2 1
1/2 1
1111011
9/27/2018 40
Dr.AtifShahzad
Decimal to Binary– Questions
14/01/2016 40
78 =
947=
301=
1294
10101010=
123456=
98123=
100=
9/27/2018 41
Dr.AtifShahzad
Conversion Details
(in general)
To Convert theIntegral Part:
Repeatedly divide the number by the new radix and save the
remainders.The digits for the new radix are the remainders
in reverse order of their computation. If the new radix is >
10, then convert all remainders > 10 to digitsA, B, …
To Convert theFractional Part:
Repeatedly multiply the fraction by the new radix and save
the integer digits that result. The digits for the new radix are
the integer digits in order of their computation. If the new
radix is > 10, then convert all integers > 10 to digitsA, B, …
14/01/2016 41
9/27/2018 42
Dr.AtifShahzad
Converting Binary to Decimal
To convert to decimal, use decimal arithmetic
to form Σ (digit × respective power of 2).
Example:Convert 11012 to N10:
= 1 × 23
+ 1 × 22
+0 × 21
+1 × 20
= 13
14/01/2016 42
9/27/2018 43
Dr.AtifShahzad
Binary to Decimal – Questions
14/01/2016 43
10001 =
101010=
1100=
10000000=
100000101=
101010101010110=
1111110=
100=
9/27/2018 44
Dr.AtifShahzad
Conversion Between Bases
14/01/2016
44
Method 2
To convert from one base to another:
1) Convert the Integer Part
2) Convert the Fraction Part
3) Join the two results with a radix point
9/27/2018 45
Dr.AtifShahzad
Example: Convert 46.687510 To
Base 2
Convert 46 to Base 2
Convert 0.6875 to Base 2:
Join the results together with the
radix point:
14/01/2016 45
9/27/2018 46
Dr.AtifShahzad
Example: Convert 46.687510 To
Base 2
Convert 46 to Base 2
46/2 = 23 rem = 0
23/2 = 11 rem = 1
11/2 = 5 remainder = 1
5/2 = 2 remainder = 1
2/2 = 1 remainder = 0
1/2 = 0 remainder = 1
Reading off in the reverse direction: 1011102
Convert 0.6875 to Base 2:
0.6875 * 2 = 1.3750 int = 1
0.3750 * 2 = 0.7500 int = 0
0.7500 * 2 = 1.5000 int = 1
0.5000 * 2 = 1.0000 int = 1
0.0000
Reading off in the forward direction: 0.10112
Join the results together with the radix point:
Combining Integral and Fractional Parts:
101110. 10112
14/01/2016 46
9/27/2018 47
Dr.AtifShahzad
exercise: Convert
Convert 46 to Base 2
Convert 321 to Base 2
Convert 89 to Base 2
Convert 74 to Base 2
14/01/2016 47
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 10
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 10
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 10
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 10
9/27/2018 48
Dr.AtifShahzad
A BrainTeaser…
It is known that octopuses with 7 legs always
lie, while those with 6 legs and those with 8
legs always tell the truth. One night, four
octopuses met:
Black — 'We have 28 legs.'
Green — 'We have 27 legs.'
Yellow— 'We have 26 legs.' 

Red — 'We have 25 legs.'
Who spoke the truth?
9/27/2018 49
Dr.AtifShahzad
Additional Issue - Fractional
Part
Note that in this conversion, the fractional part
became 0 as a result of the repeated multiplications.
In general, it may take many bits to get this to happen
or it may never happen.
Example: Convert 0.6510 to N2
0.65 = 0.1010011001001 …
The fractional part begins repeating every 4 steps yielding
repeating 1001 forever!
Solution: Specify number of bits to right of radix
point and round or truncate to this number.
14/01/2016 49
9/27/2018 50
Dr.AtifShahzad
Checking the Conversion
To convert back, sum the digits times their
respective powers of r.
From the prior conversion of 46.687510
1011102 = 1·32 + 0·16 +1·8 +1·4 + 1·2 +0·1
= 32 + 8 + 4 + 2
= 46
0.10112 = 1/2 + 1/8 + 1/16
= 0.5000 + 0.1250 + 0.0625
= 0.6875
14/01/2016 50
9/27/2018 52
Dr.AtifShahzad
Octal to Binary
Octal to Binary:
Restate the octal as three binary digits starting at
the radix point and going both ways.
Example: 1438
110 =001
410=100
310=011
so 1438 = 001 100 0112
14/01/2016 52
9/27/2018 53
Dr.AtifShahzad
Hexadecimal to Binary
Hexadecimal to Binary:
Restate the octal as four binary digits starting at
the radix point and going both ways.
Example: 14316
110 =0001
410=0100
310=0011
so 14316 = 0001 0100 0011 2
14/01/2016 53
9/27/2018 54
Dr.AtifShahzad
Binary to Octal
Binary to Octal :
Group the binary digits into three bit groups
starting at the radix point and going both ways,
padding with zeros as needed in the fractional
part.
Convert each group of three bits to an octal digit.
001100011 2= 001 100 011 2
Implies 1438
14/01/2016 54
9/27/2018 55
Dr.AtifShahzad
Binary to hexadecimal
Binary to hexadecimal:
Group the binary digits into four bit groups starting
at the radix point and going both ways, padding with
zeros as needed in the fractional part.
Convert each group of four bits to an hexadecimal
digit.
0001010000112= 0001 0100 00112
Implies 14316
14/01/2016 55
9/27/2018 56
Dr.AtifShahzad
exercise: Convert
14/01/2016 56
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟖𝟖 to Base 2
Convert 𝟑𝟑𝟑𝟑𝟑𝟑𝟖𝟖 to Base 2
Convert 𝟏𝟏𝟕𝟕𝟎𝟎𝟎𝟎𝟓𝟓𝟎𝟎𝟖𝟖 to Base 2
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟖𝟖 to Base 2
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏 to Base 2
Convert 𝟕𝟕𝟕𝟕𝟏𝟏𝟏𝟏 to Base 2
Convert 𝑨𝑨𝑨𝑨𝑨𝑨𝟏𝟏𝟏𝟏 to Base 2
Convert 𝟗𝟗𝟗𝟗𝟗𝟗𝟏𝟏𝟏𝟏 to Base 2
9/27/2018 57
Dr.AtifShahzad
exercise: Convert
14/01/2016 57
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 8
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 8
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟖𝟖 to Base 8
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 6
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 16
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 16
Convert 𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟐𝟐 to Base 16
Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 16
9/27/2018 58
Dr.AtifShahzad
Octal to Hexadecimal via
Binary
Convert octal to binary.
Use groups of four bits and convert as above
to hexadecimal digits.
Example: Octal to Binary to Hexadecimal
6 3 5 8
14/01/2016 58
9/27/2018 59
Dr.AtifShahzad
Octal to Hexadecimal via
Binary--Question
(6 3 5 . 1 7 7) 8
14/01/2016 59
9/27/2018 60
Dr.AtifShahzad
A Final Conversion Note
You can use arithmetic in other bases if
you are careful:
Example: Convert 1011102 to Base 10
using binary arithmetic:
Step 1 101110 / 1010 = 100 r 0110
Step 2 100 / 1010 = 0 r 0100
Converted Digits are 01002 | 01102
or 4 6 10
14/01/2016 60
9/27/2018 61
Dr.AtifShahzad
Binary Numbers and Binary
Coding
Flexibility of representation
Within constraints below, can assign any binary
combination (called a code word) to any data as long as
data is uniquely encoded.
InformationTypes
Numeric
Must represent range of data needed
Very desirable to represent data such that simple, straightforward
computation for common arithmetic operations permitted
Tight relation to binary numbers
Non-numeric
Greater flexibility since arithmetic operations not applied.
Not tied to binary numbers
14/01/2016 61
9/27/2018 62
Dr.AtifShahzad
BrainTeaser…
25
+ 24
+ 23
+ 22
+ 21
+2
=?
26
+ 1
26
− 1
26
36
9/27/2018 63
Dr.AtifShahzad
There are 3 boxes, exactly one of which has a
chocolate.You can keep the chocolate if you pick
the correct box!
On each box there is a statement, exactly one of
which is true.
• Box 1:The chocolate is in this box.
• Box 2:The chocolate is not in this box.
• Box 3:The chocolate is not in box 1.
Which box has the chocolate ?
.
14/01/2016 63
14-Jan-16
Dr.AtifShahzad
65
14-Jan-16
Dr.AtifShahzad
66
NEVER hesitate to
contact should you
have any question
Dr. Atif Shahzad

More Related Content

Similar to Lecture02 ie321 dr_atifshahzad

Data types
Data typesData types
Data types
gavhays
 
mws_gen_aae_spe_pptintroduction.ppt
mws_gen_aae_spe_pptintroduction.pptmws_gen_aae_spe_pptintroduction.ppt
mws_gen_aae_spe_pptintroduction.ppt
SudeepThapaliya1
 

Similar to Lecture02 ie321 dr_atifshahzad (20)

A Hacking Toolset for Big Tabular Files (3)
A Hacking Toolset for Big Tabular Files (3)A Hacking Toolset for Big Tabular Files (3)
A Hacking Toolset for Big Tabular Files (3)
 
Comparative Study on DES and Triple DES Algorithms and Proposal of a New Algo...
Comparative Study on DES and Triple DES Algorithms and Proposal of a New Algo...Comparative Study on DES and Triple DES Algorithms and Proposal of a New Algo...
Comparative Study on DES and Triple DES Algorithms and Proposal of a New Algo...
 
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem
USUGM 2014 - Dana Vanderwall (Bristol-Myers Squibb): Instant JChem
 
Lecture01 ie321 dr_atifshahzad
Lecture01 ie321 dr_atifshahzadLecture01 ie321 dr_atifshahzad
Lecture01 ie321 dr_atifshahzad
 
SNOMED CT in the clinical data standards landscape
SNOMED CT in the clinical data standards landscape SNOMED CT in the clinical data standards landscape
SNOMED CT in the clinical data standards landscape
 
Data types
Data typesData types
Data types
 
MPMC Architecture of 8085 Microprocessor and Programming.pptx
MPMC Architecture of 8085 Microprocessor and Programming.pptxMPMC Architecture of 8085 Microprocessor and Programming.pptx
MPMC Architecture of 8085 Microprocessor and Programming.pptx
 
Feature Engineering
Feature Engineering Feature Engineering
Feature Engineering
 
Lecture03 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzadLecture03 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzad
 
AVEVA World Conference NA - Todd Kubiak, AVEVA NET
AVEVA World Conference NA - Todd Kubiak, AVEVA NETAVEVA World Conference NA - Todd Kubiak, AVEVA NET
AVEVA World Conference NA - Todd Kubiak, AVEVA NET
 
8086 architecture
8086 architecture8086 architecture
8086 architecture
 
Lecture03 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzadLecture03 computer applicationsie1_dratifshahzad
Lecture03 computer applicationsie1_dratifshahzad
 
mws_gen_aae_spe_pptintroduction.ppt
mws_gen_aae_spe_pptintroduction.pptmws_gen_aae_spe_pptintroduction.ppt
mws_gen_aae_spe_pptintroduction.ppt
 
R in finance: Introduction to R and Its Applications in Finance
R in finance: Introduction to R and Its Applications in FinanceR in finance: Introduction to R and Its Applications in Finance
R in finance: Introduction to R and Its Applications in Finance
 
2016 SDMX Experts meeting, SDMX for statistical data and metadata modelling, ...
2016 SDMX Experts meeting, SDMX for statistical data and metadata modelling, ...2016 SDMX Experts meeting, SDMX for statistical data and metadata modelling, ...
2016 SDMX Experts meeting, SDMX for statistical data and metadata modelling, ...
 
Data analysis
Data analysisData analysis
Data analysis
 
Representation of Positive Numbers
Representation of Positive NumbersRepresentation of Positive Numbers
Representation of Positive Numbers
 
STING: Spatio-Temporal Interaction Networks and Graphs for Intel Platforms
STING: Spatio-Temporal Interaction Networks and Graphs for Intel PlatformsSTING: Spatio-Temporal Interaction Networks and Graphs for Intel Platforms
STING: Spatio-Temporal Interaction Networks and Graphs for Intel Platforms
 
Forecasting time series powerful and simple
Forecasting time series powerful and simpleForecasting time series powerful and simple
Forecasting time series powerful and simple
 
Using Graph Algorithms for Advanced Analytics - Part 2 Centrality
Using Graph Algorithms for Advanced Analytics - Part 2 CentralityUsing Graph Algorithms for Advanced Analytics - Part 2 Centrality
Using Graph Algorithms for Advanced Analytics - Part 2 Centrality
 

More from Atif Shahzad

Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmeaDr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Atif Shahzad
 
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Atif Shahzad
 

More from Atif Shahzad (20)

Lecture04 computer applicationsie1_dratifshahzad
Lecture04 computer applicationsie1_dratifshahzadLecture04 computer applicationsie1_dratifshahzad
Lecture04 computer applicationsie1_dratifshahzad
 
Lecture01 computer applicationsie1_dratifshahzad
Lecture01 computer applicationsie1_dratifshahzadLecture01 computer applicationsie1_dratifshahzad
Lecture01 computer applicationsie1_dratifshahzad
 
Lecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzadLecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzad
 
Lecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzadLecture02 computer applicationsie1_dratifshahzad
Lecture02 computer applicationsie1_dratifshahzad
 
Dr atif shahzad_sys_ management_lecture_agile
Dr atif shahzad_sys_ management_lecture_agileDr atif shahzad_sys_ management_lecture_agile
Dr atif shahzad_sys_ management_lecture_agile
 
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmeaDr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
Dr atif shahzad_sys_ management_lecture_10_risk management_fmea_vmea
 
Dr atif shahzad_engg_ management_module_01
Dr atif shahzad_engg_ management_module_01Dr atif shahzad_engg_ management_module_01
Dr atif shahzad_engg_ management_module_01
 
Dr atif shahzad_engg_ management_lecture_inventory models
Dr atif shahzad_engg_ management_lecture_inventory modelsDr atif shahzad_engg_ management_lecture_inventory models
Dr atif shahzad_engg_ management_lecture_inventory models
 
Dr atif shahzad_engg_ management_lecture_inventory management
Dr atif shahzad_engg_ management_lecture_inventory managementDr atif shahzad_engg_ management_lecture_inventory management
Dr atif shahzad_engg_ management_lecture_inventory management
 
Dr atif shahzad_engg_ management_cost management
Dr atif shahzad_engg_ management_cost managementDr atif shahzad_engg_ management_cost management
Dr atif shahzad_engg_ management_cost management
 
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
Dr atif shahzad_sys_ management_lecture_outsourcing managing inter organizati...
 
Lecture17 ie321 dr_atifshahzad_js
Lecture17 ie321 dr_atifshahzad_jsLecture17 ie321 dr_atifshahzad_js
Lecture17 ie321 dr_atifshahzad_js
 
Lecture16 ie321 dr_atifshahzad_css
Lecture16 ie321 dr_atifshahzad_cssLecture16 ie321 dr_atifshahzad_css
Lecture16 ie321 dr_atifshahzad_css
 
Lecture15 ie321 dr_atifshahzad_html
Lecture15 ie321 dr_atifshahzad_htmlLecture15 ie321 dr_atifshahzad_html
Lecture15 ie321 dr_atifshahzad_html
 
Lecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networksLecture12 ie321 dr_atifshahzad - networks
Lecture12 ie321 dr_atifshahzad - networks
 
Lecture11 ie321 dr_atifshahzad -security
Lecture11 ie321 dr_atifshahzad -securityLecture11 ie321 dr_atifshahzad -security
Lecture11 ie321 dr_atifshahzad -security
 
Lecture10 ie321 dr_atifshahzad
Lecture10 ie321 dr_atifshahzadLecture10 ie321 dr_atifshahzad
Lecture10 ie321 dr_atifshahzad
 
Lecture08 ie321 dr_atifshahzad
Lecture08 ie321 dr_atifshahzadLecture08 ie321 dr_atifshahzad
Lecture08 ie321 dr_atifshahzad
 
Lecture06 ie321 dr_atifshahzad
Lecture06 ie321 dr_atifshahzadLecture06 ie321 dr_atifshahzad
Lecture06 ie321 dr_atifshahzad
 
Lecture05 ie321 dr_atifshahzad
Lecture05 ie321 dr_atifshahzadLecture05 ie321 dr_atifshahzad
Lecture05 ie321 dr_atifshahzad
 

Recently uploaded

%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 

Recently uploaded (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 

Lecture02 ie321 dr_atifshahzad

  • 1. 14-Jan-16 Dr.AtifShahzad 1 DR ATIF SHAHZAD Fundamentals of Computer Systems IE-321 LECTURE #02
  • 2. 9/27/2018 2 Dr.AtifShahzad RECAP Page 1 Course Objectives Rules & regulations Grading scheme Teaching Methodology An overview of topics Logic examples A simple Logic thinking process
  • 3. 9/27/2018 3 Dr.AtifShahzad TODAY’S LECTURE Digital System What is a Numbering System? Commonly Occurring Bases Numbering System Examples Base Conversion Procedure Base Conversion Number of Bits Required Number of Elements represented BCD, GRAY, ASCII & UNICODE Q&A
  • 5. 14/01/2016 Dr.AtifShahzad 5 Robert Noyce, 1927 - 1990 • Nicknamed“Mayor of Silicon Valley” • Cofounded Fairchild Semiconductor in 1957 • Cofounded Intel in 1968 • Co-invented the integrated circuit Logic Automatisms by Dr. Atif Shahzad9/27/2018 5
  • 6. 14/01/2016 Dr.AtifShahzad 6 Gordon Moore, 1929 - • Cofounded Intel in 1968 with Robert Noyce. • Moore’s Law:the number of transistors on a computer chip doubles every year (observed in 1965) • Since 1975,transistor counts have doubled every two years. Logic Automatisms by Dr. Atif Shahzad9/27/2018 6
  • 7. 14/01/2016 Dr.AtifShahzad 7 DigitalValues Discrete set of values Logic Automatisms by Dr. Atif Shahzad9/27/2018 7
  • 8. 9/27/2018 8 Dr.AtifShahzad Digital System Takes a set of discrete informationinputs and discrete internal information (system state) and generates a set of discrete information outputs. 14/01/2016 8 System State Discrete Information Processing System Discrete Inputs Discrete Outputs
  • 9. 9/27/2018 9 Dr.AtifShahzad Types of Digital Systems 14/01/2016 9 No state present Combination al Logic System Output = Function (Input) State present State updated at discrete times => Synchronous Sequential System State updated at any time => Asynchronous Sequential System State = Function (State, Input) Output = Function (State) or Function (State, Input)
  • 10. 9/27/2018 10 Dr.AtifShahzad Digital Systems TwoVoltage Levels Two States • On/Off • Black/White • Hot/Cold • Stationary/Moving Logic Automatisms by Dr. Atif Shahzad9/27/201810
  • 11. 9/27/2018 11 Dr.AtifShahzad Digital System Example: 14/01/2016 11 A Digital Counter (e.g.,odometer): 1 30 0 5 6 4 Count Up Reset Inputs: Count Up,Reset Outputs: Visual Display State: "Value" of stored digits
  • 12. 9/27/2018 12 Dr.AtifShahzad A Digital Computer Example 14/01/2016 12 Synchronous or Asynchronous? Inputs: Keyboard, mouse, modem, microphone Outputs: CRT, LCD, modem, speakers Memory Control unit Datapath Input/Output CPU
  • 13. 9/27/2018 13 Dr.AtifShahzad Digital Systems and Computer Systems 9/27/201813Logic Automatisms by Dr. Atif Shahzad
  • 14. 9/27/2018 14 Dr.AtifShahzad Signal An information variable represented by physical quantity. For digital systems, the variable takes on discrete values. 14/01/2016 14
  • 15. 9/27/2018 15 Dr.AtifShahzad Signal Two level, or binary values are the most prevalent values in digital systems. Binary values are represented by values or ranges of values of physical quantities Binaryvaluesare representedabstractlyby: digits 0 and 1 words (symbols) False (F) andTrue (T) words (symbols) Low (L) and High (H) words On and Off.
  • 16. 9/27/2018 16 Dr.AtifShahzad Signal Examples OverTime 14/01/2016 16 Analog Asynchronous Synchronous Time Continuous in value & time Discrete in value & continuous in time Discrete in value & time Digital
  • 17. 9/27/2018 17 Dr.AtifShahzad 5.0 4.0 3.0 2.0 1.0 0.0 Volts HIGH LOW HIGH LOW OUTPUT INPUT Signal Example – Physical Quantity: Voltage 14/01/2016 17 Threshold Region
  • 18. 9/27/2018 18 Dr.AtifShahzad BinaryValues: Other Physical Quantities CPU:Voltage Disk: Magnetic Field Direction CD: Surface Pits/Light Dynamic RAM: Electrical Charge 14/01/2016 18 What do other physical quantities represent 0 and 1?
  • 20. 9/27/2018 20 Dr.AtifShahzad Number Systems [binary, octal and hexadecimal] 9/27/201820Logic Automatisms by Dr. Atif Shahzad
  • 21. 9/27/2018 21 Dr.AtifShahzad Number Systems – Representation in positional number systems Radix is represented by a string of digits: dn – 1dn - 2 … d1d0 . d- 1 d- 2 … d- m + 1 d- m in which 0 ∈ Ai < r and . is the radix point. A number with radix r represents the power series: The string of digits 14/01/2016 21 𝑑𝑑𝑛𝑛−1 … 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0 = � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 10𝑖𝑖
  • 22. 9/27/2018 22 Dr.AtifShahzad Number Systems – Examples 14/01/2016 22 123 = 1 × 102 + 2 × 101 +3 × 100 � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 10𝑖𝑖
  • 23. 9/27/2018 23 Dr.AtifShahzad Number Systems – Questions 14/01/2016 23 78 = 947= 301= 1294 10101010= 123456= 98123= � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 10𝑖𝑖
  • 24. 9/27/2018 24 Dr.AtifShahzad Number Systems – Examples 14/01/2016 24 General Decimal Binary Radix (Base) r 10 2 Digits 0 => r - 1 0 => 9 0 => 1 0 1 2 3 Powers of 4 Radix 5 -1 -2 -3 -4 -5 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
  • 25. 9/27/2018 25 Dr.AtifShahzad Binary Number representation 14/01/2016 25 � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 2𝑖𝑖 (𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)2 = � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 2𝑖𝑖
  • 26. 9/27/2018 26 Dr.AtifShahzad Binary Number representation- EXAMPLE 14/01/2016 26 � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 2𝑖𝑖 (𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)2 = � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 2𝑖𝑖 11012 = 1 × 23 +1 × 22 + 0 × 21 +1 × 20
  • 27. 9/27/2018 27 Dr.AtifShahzad Binary Number representation- EXAMPLE 14/01/2016 27 The digits of the binary number are called bits MSB=Most Significant Bit LSB=Least Significant Bit (𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)2 = � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 2𝑖𝑖 11012 = 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20 Group of 8 bits = 1 Byte
  • 28. 9/27/2018 28 Dr.AtifShahzad Representation of a Binary Number-Example 14/01/2016 28 MSB Binary Digit LSB 28 27 26 25 24 23 22 21 20 256 128 64 32 16 8 4 2 1
  • 29. 9/27/2018 29 Dr.AtifShahzad Binary Number Names & Prefixes Number of Binary Digits (bits) Common Name 1 Bit 4 Nibble 8 Byte 16 Word 32 DoubleWord 64 QuadWord 14/01/2016 29
  • 30. 9/27/2018 30 Dr.AtifShahzad Special Powers of 2 14/01/2016 30 210 (1024) is Kilo,denoted "K" 220 (1,048,576) is Mega,denoted "M" 230 (1,073,741,824) is Giga,denoted "G"
  • 31. 9/27/2018 31 Dr.AtifShahzad Positive Powers of 2 Useful for Base Conversion 14/01/2016 31 Exponent Value Exponent Value 0 1 11 2,048 1 2 12 4,096 2 4 13 8,192 3 8 14 16,384 4 16 15 32,768 5 32 16 65,536 6 64 17 131,072 7 128 18 262,144 19 524,288 20 1,048,576 21 2,097,152 8 256 9 512 10 1024
  • 32. 9/27/2018 32 Dr.AtifShahzad Positive Powers of 2 Useful for Base Conversion 14/01/2016 32 Exponent Value Exponent Value 0 1 11 2,048 1 2 12 4,096 2 4 13 8,192 3 8 14 16,384 4 16 15 32,768 5 32 16 65,536 6 64 17 131,072 7 128 18 262,144 19 524,288 20 1,048,576 21 2,097,152 8 256 9 512 10 1024
  • 33. 9/27/2018 33 Dr.AtifShahzad In general… 14/01/2016 33 (𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)2 = � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 2𝑖𝑖 (𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)10 = � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 10𝑖𝑖 (𝑑𝑑𝑛𝑛−1… 𝑑𝑑2 𝑑𝑑1 𝑑𝑑0)𝑏𝑏 = � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 𝑏𝑏𝑖𝑖
  • 34. 9/27/2018 34 Dr.AtifShahzad Binary Number Systems – Questions 14/01/2016 34 10001 = 101010= 1100= 10000000= 100000101= 101010101010110= 1111110= � 𝑖𝑖=𝑛𝑛−1 0 𝑑𝑑𝑖𝑖. 2𝑖𝑖
  • 35. 9/27/2018 35 Dr.AtifShahzad Usage of Number systems Name Description Binary Computers Octal Occasionally in Computing Decimal Everywhere Duodecimal (dozenal) Quantities like dozens Hexadecimal Used in Computing Vigesimal Traditional in some cultures Sexagesimal Cirular coordinate system (Angle and time) Radix 2 8 10 12 16 20 60
  • 36. 9/27/2018 36 Dr.AtifShahzad Commonly Occurring Bases 14/01/2016 36 Name Base Digits Binary 2 0,1 Octal 8 0,1,2,3,4,5,6,7 Decimal 10 0,1,2,3,4,5,6,7,8,9 Hexadecimal 16 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F The six letters (in addition to the 10 integers) in hexadecimal represent: 10,11,12,13,14,15
  • 37. 9/27/2018 37 Dr.AtifShahzad Decimal (Base 10) Binary (Base 2) Octal (Base 8) Hexadecimal (Base 16) 00 00000 00 00 01 00001 01 01 02 00010 02 02 03 00011 03 03 04 00100 04 04 05 00101 05 05 06 00110 06 06 07 00111 07 07 08 01000 10 08 09 01001 11 09 10 01010 12 0A 11 01011 13 0B 12 01100 14 0C 13 01101 15 0D 14 01110 16 0E 15 01111 17 0F 16 10000 20 10 Numbers in Different Bases Good idea to memorize! 14/01/2016 37
  • 38. 9/27/2018 38 Dr.AtifShahzad Base Conversion How to convert from one base system to other ? Any Idea? 14/01/2016 38
  • 39. 9/27/2018 39 Dr.AtifShahzad Converting Decimal to Binary Successively divide the decimal number by 2 Record the remainders after each division The remainders written in reverse order form the binary number 14/01/2016 39 Example:Convert 12310 to N2 123/2 1 61/2 1 30/2 0 15/2 1 7/2 1 3/2 1 1/2 1 1111011
  • 40. 9/27/2018 40 Dr.AtifShahzad Decimal to Binary– Questions 14/01/2016 40 78 = 947= 301= 1294 10101010= 123456= 98123= 100=
  • 41. 9/27/2018 41 Dr.AtifShahzad Conversion Details (in general) To Convert theIntegral Part: Repeatedly divide the number by the new radix and save the remainders.The digits for the new radix are the remainders in reverse order of their computation. If the new radix is > 10, then convert all remainders > 10 to digitsA, B, … To Convert theFractional Part: Repeatedly multiply the fraction by the new radix and save the integer digits that result. The digits for the new radix are the integer digits in order of their computation. If the new radix is > 10, then convert all integers > 10 to digitsA, B, … 14/01/2016 41
  • 42. 9/27/2018 42 Dr.AtifShahzad Converting Binary to Decimal To convert to decimal, use decimal arithmetic to form Σ (digit × respective power of 2). Example:Convert 11012 to N10: = 1 × 23 + 1 × 22 +0 × 21 +1 × 20 = 13 14/01/2016 42
  • 43. 9/27/2018 43 Dr.AtifShahzad Binary to Decimal – Questions 14/01/2016 43 10001 = 101010= 1100= 10000000= 100000101= 101010101010110= 1111110= 100=
  • 44. 9/27/2018 44 Dr.AtifShahzad Conversion Between Bases 14/01/2016 44 Method 2 To convert from one base to another: 1) Convert the Integer Part 2) Convert the Fraction Part 3) Join the two results with a radix point
  • 45. 9/27/2018 45 Dr.AtifShahzad Example: Convert 46.687510 To Base 2 Convert 46 to Base 2 Convert 0.6875 to Base 2: Join the results together with the radix point: 14/01/2016 45
  • 46. 9/27/2018 46 Dr.AtifShahzad Example: Convert 46.687510 To Base 2 Convert 46 to Base 2 46/2 = 23 rem = 0 23/2 = 11 rem = 1 11/2 = 5 remainder = 1 5/2 = 2 remainder = 1 2/2 = 1 remainder = 0 1/2 = 0 remainder = 1 Reading off in the reverse direction: 1011102 Convert 0.6875 to Base 2: 0.6875 * 2 = 1.3750 int = 1 0.3750 * 2 = 0.7500 int = 0 0.7500 * 2 = 1.5000 int = 1 0.5000 * 2 = 1.0000 int = 1 0.0000 Reading off in the forward direction: 0.10112 Join the results together with the radix point: Combining Integral and Fractional Parts: 101110. 10112 14/01/2016 46
  • 47. 9/27/2018 47 Dr.AtifShahzad exercise: Convert Convert 46 to Base 2 Convert 321 to Base 2 Convert 89 to Base 2 Convert 74 to Base 2 14/01/2016 47 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 10 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 10 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 10 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 10
  • 48. 9/27/2018 48 Dr.AtifShahzad A BrainTeaser… It is known that octopuses with 7 legs always lie, while those with 6 legs and those with 8 legs always tell the truth. One night, four octopuses met: Black — 'We have 28 legs.' Green — 'We have 27 legs.' Yellow— 'We have 26 legs.' 
 Red — 'We have 25 legs.' Who spoke the truth?
  • 49. 9/27/2018 49 Dr.AtifShahzad Additional Issue - Fractional Part Note that in this conversion, the fractional part became 0 as a result of the repeated multiplications. In general, it may take many bits to get this to happen or it may never happen. Example: Convert 0.6510 to N2 0.65 = 0.1010011001001 … The fractional part begins repeating every 4 steps yielding repeating 1001 forever! Solution: Specify number of bits to right of radix point and round or truncate to this number. 14/01/2016 49
  • 50. 9/27/2018 50 Dr.AtifShahzad Checking the Conversion To convert back, sum the digits times their respective powers of r. From the prior conversion of 46.687510 1011102 = 1·32 + 0·16 +1·8 +1·4 + 1·2 +0·1 = 32 + 8 + 4 + 2 = 46 0.10112 = 1/2 + 1/8 + 1/16 = 0.5000 + 0.1250 + 0.0625 = 0.6875 14/01/2016 50
  • 51. 9/27/2018 52 Dr.AtifShahzad Octal to Binary Octal to Binary: Restate the octal as three binary digits starting at the radix point and going both ways. Example: 1438 110 =001 410=100 310=011 so 1438 = 001 100 0112 14/01/2016 52
  • 52. 9/27/2018 53 Dr.AtifShahzad Hexadecimal to Binary Hexadecimal to Binary: Restate the octal as four binary digits starting at the radix point and going both ways. Example: 14316 110 =0001 410=0100 310=0011 so 14316 = 0001 0100 0011 2 14/01/2016 53
  • 53. 9/27/2018 54 Dr.AtifShahzad Binary to Octal Binary to Octal : Group the binary digits into three bit groups starting at the radix point and going both ways, padding with zeros as needed in the fractional part. Convert each group of three bits to an octal digit. 001100011 2= 001 100 011 2 Implies 1438 14/01/2016 54
  • 54. 9/27/2018 55 Dr.AtifShahzad Binary to hexadecimal Binary to hexadecimal: Group the binary digits into four bit groups starting at the radix point and going both ways, padding with zeros as needed in the fractional part. Convert each group of four bits to an hexadecimal digit. 0001010000112= 0001 0100 00112 Implies 14316 14/01/2016 55
  • 55. 9/27/2018 56 Dr.AtifShahzad exercise: Convert 14/01/2016 56 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟖𝟖 to Base 2 Convert 𝟑𝟑𝟑𝟑𝟑𝟑𝟖𝟖 to Base 2 Convert 𝟏𝟏𝟕𝟕𝟎𝟎𝟎𝟎𝟓𝟓𝟎𝟎𝟖𝟖 to Base 2 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟖𝟖 to Base 2 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏 to Base 2 Convert 𝟕𝟕𝟕𝟕𝟏𝟏𝟏𝟏 to Base 2 Convert 𝑨𝑨𝑨𝑨𝑨𝑨𝟏𝟏𝟏𝟏 to Base 2 Convert 𝟗𝟗𝟗𝟗𝟗𝟗𝟏𝟏𝟏𝟏 to Base 2
  • 56. 9/27/2018 57 Dr.AtifShahzad exercise: Convert 14/01/2016 57 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 8 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 8 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟖𝟖 to Base 8 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 6 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 16 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 16 Convert 𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟎𝟐𝟐 to Base 16 Convert 𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟏𝟐𝟐 to Base 16
  • 57. 9/27/2018 58 Dr.AtifShahzad Octal to Hexadecimal via Binary Convert octal to binary. Use groups of four bits and convert as above to hexadecimal digits. Example: Octal to Binary to Hexadecimal 6 3 5 8 14/01/2016 58
  • 58. 9/27/2018 59 Dr.AtifShahzad Octal to Hexadecimal via Binary--Question (6 3 5 . 1 7 7) 8 14/01/2016 59
  • 59. 9/27/2018 60 Dr.AtifShahzad A Final Conversion Note You can use arithmetic in other bases if you are careful: Example: Convert 1011102 to Base 10 using binary arithmetic: Step 1 101110 / 1010 = 100 r 0110 Step 2 100 / 1010 = 0 r 0100 Converted Digits are 01002 | 01102 or 4 6 10 14/01/2016 60
  • 60. 9/27/2018 61 Dr.AtifShahzad Binary Numbers and Binary Coding Flexibility of representation Within constraints below, can assign any binary combination (called a code word) to any data as long as data is uniquely encoded. InformationTypes Numeric Must represent range of data needed Very desirable to represent data such that simple, straightforward computation for common arithmetic operations permitted Tight relation to binary numbers Non-numeric Greater flexibility since arithmetic operations not applied. Not tied to binary numbers 14/01/2016 61
  • 61. 9/27/2018 62 Dr.AtifShahzad BrainTeaser… 25 + 24 + 23 + 22 + 21 +2 =? 26 + 1 26 − 1 26 36
  • 62. 9/27/2018 63 Dr.AtifShahzad There are 3 boxes, exactly one of which has a chocolate.You can keep the chocolate if you pick the correct box! On each box there is a statement, exactly one of which is true. • Box 1:The chocolate is in this box. • Box 2:The chocolate is not in this box. • Box 3:The chocolate is not in box 1. Which box has the chocolate ? . 14/01/2016 63
  • 64. 14-Jan-16 Dr.AtifShahzad 66 NEVER hesitate to contact should you have any question Dr. Atif Shahzad