Professional Documents
Culture Documents
Fall 2010
Instructor: Mansoor Naseer
mansoor@bahria.edu.pk
Bahria University, Islamabad
Course Information
Group/Web Page:
• Webpage: http://groups.google.com.pk/group/dld2010f
p g p g g p g p
• Current email address: dld2010f@googlegroups.com
Marks Distribution:
• Quizzes: 10%
• A i
Assignments/Projects:
t /P j t 20%
• Midterm Examination: 20%
• Final Examination: 50%
• Labs: 100% ggrade constitutingg 1 credit hour
Grading Policy:
• 87 – 100 : A
• 80 – 86 : B+
• 72 – 79 : B
• 66 – 71 : C+
• 60 – 65 : C
• <60 : F
Learning Objectives
Chapter 1 7
DIGITAL & COMPUTER SYSTEMS - Digital
System
Discrete Discrete
I
Inputs Information
Processing Discrete
System Outputs
System State
Chapter 1 8
Types of Digital Systems
No state present
• Combinational Logic System
• Output = Function(Input)
S
Statee present
p ese
• State updated at discrete times
=> Synchronous Sequential System
• State updated at any time
=>Asynchronous Sequential System
• State
S =F
Function
i (State,
(S I
Input)
)
• Output = Function (State)
or Function ((State,, Input)
p )
Chapter 1 9
Digital System Example:
Count Up
Reset 0 0 1 3 5 6 4
IInputs:
t Count U
C Up, R
Reset
Outputs: Visual Display
State: "Value"
Value of stored digits
Synchronous or Asynchronous?
Chapter 1 10
Digital Computer Example
Memoryy
Control
CPU unit Datapath
Inputs:
Outputs: LCD
keyboard, mouse,
screen, wireless,
wireless, Input/Output speakers
k
microphone
Synchronous or
Asynchronous?
Chapter 1 11
And Beyond – Embedded Systems
Chapter 1 12
Embedded Systems
Chapter 1 13
INFORMATION REPRESENTATION - Signals
Chapter 1 14
Signal Examples Over Time
Time
Continuous
Analog in value &
time
Digital Discrete
Di t iin
value &
Asynchronous continuous
in time
Synchronous Discrete in
value & time
Chapter 1 15
Signal Example – Physical Quantity: Voltage
Threshold
R i
Region
Chapter 1 16
Binary Values: Other Physical Quantities
Chapter 1 17
NUMBER SYSTEMS – Representation
(Number)r = (∑
i=n-1
Ai r )+( ∑
i
j=-1
Aj r)
j
i=0 j=-m
(Integer Portion) + (Fraction Portion)
Chapter 1 18
Number Systems – Examples
Chapter 1 19
Special Powers of 2
240 (1,099,511,627,776
(1 099 511 627 776 ) is
i Tera,
T denoted
d t d “T"
Chapter 1 20
ARITHMETIC OPERATIONS - Binary
Arithmetic
Chapter 1 21
Single Bit Binary Addition with Carry
Carry in (Z) of 1: Z 1 1 1 1
X 0 0 1 1
+Y +0 +1 +0 +1
CS 01 10 10 11
Chapter 1 22
Multiple Bit Binary Addition
Chapter 1 23
Single Bit Binary Subtraction with Borrow
Given two binary digits (X,Y), a borrow in (Z) we
get the following difference (S) and borrow (B):
Borrow in (Z) of 0: Z 0 0 0 0
X 0 0 1 1
-Y -0 -1 -0 -1
BS 00 11 01 00
Borrow in (Z) of 1: Z 1 1 1 1
X 0 0 1 1
-Y -0 -1 -0 -1
BS 11 10 00 11
Chapter 1 24
Multiple Bit Binary Subtraction
Chapter 1 25
Binary Multiplication
Chapter 1 28
Converting Decimal to Binary
Method 1
• Subtract the largest power of 2 (see slide 14) that gives
a positive remainder and record the power.
• Repeat, subtracting from the prior remainder and
recording the power,
power until the remainder is zero.
zero
• Place 1’s in the positions in the binary result
corresponding to the powers recorded; in all other
positions place 00’ss.
Example: Convert 62510 to N2
Chapter 1 29
Commonly Occurring Bases
Chapter 1 30
Numbers in Different Bases
Method 2
To convert from one base to another:
1) Convert the Integer Part
2) Convert the Fraction Part
3) JJoin
i th
the ttwo results
lt with
ith a radix
di point
i t
Chapter 1 32
Conversion Details
Chapter 1 33
Example: Convert 46.687510 To Base 2
Convert 46 to Base 2
Chapter 1 36
Octal (Hexadecimal) to Binary and
Back
Octal (Hexadecimal) to Binary:
• Restate
R the
h octall (h
(hexadecimal)
d i l) as three
h
(four) binary digits starting at the radix
point and going both ways.
Binary to Octal (Hexadecimal):
• Group the binary digits into three (four) bit
groups starting at the radix point and going
both ways, padding with zeros as needed in
th ffractional
the ti l part.
t
• Convert each group of three bits to an octal
(hexadecimal) digit.
digit
Chapter 1 37
Octal to Hexadecimal via Binary
Chapter 1 38
Binary Coded Decimal (BCD)
Chapter 1 39
Excess 3 Code and 8, 4, –2, –1 Code
Chapter 1 41
BCD Arithmetic
Given a BCD code, we use binary arithmetic to add the digits:
8 1000 Eightg
+5 +0101 Plus 5
13 1101 is 13 (> 9)
N
Note that the result is MORE
O THAN N 9,, so must be
represented by two digits!
To correct the digit, subtract 10 by adding 6 modulo 16.
8 1000 Eight
+5 +0101 Plus 5
13 1101 is 13 (> 9)
+0110
0110 so adddd 6
carry = 1 0011 leaving 3 + cy
0001 | 0011 Final answer (two digits)g
If the digit sum is > 9, add one to the next significant digit
Chapter 1 42
BCD Addition Example
Chapter 1 43
ALPHANUMERIC CODES - ASCII Character
Codes
American Standard Code for Information
Interchangeg (Refer to Table 1 -44 in the text)
This code is a popular code used to represent
information sent as character-based data. It uses
7-bits to represent:
• 94 Graphic printing characters.
• 34 Non-printing
Non printing characters
Some non-printing characters are used for text
format ((e.g.
g BS = Backspace,
p , CR = carriage g
return)
Other non-printing characters are used for record
marking
ki and d fl
flow control
t l ((e.g. STX and
d ETX start
t t
and end text areas).
Chapter 1 44
ASCII Properties
Chapter 1 45
4-Bit Parity Code Example
Chapter 1 47