You are on page 1of 63

Instructor: Assoc Prof Dr.

Muhammad Imran
 Dr. Muhammad Imran
 PhD – Electrical (Telecom) Engg – MCS-NUST (2014)
 MS – Electrical (Telecom) Engg – MCS-NUST (2011)
 BE – Communication System Engg – SEECS-NUST (2007)
 Research Interests – Control systems, Model Reduction,
Signal Processing, Communication Systems
 Author of 40x ISI indexed Journals and 11x Conference
Publications
 4x PhD students and 3x MS students under supervision
 19x MS Students complete their degrees
 http://www.nust.edu.pk/INSTITUTIONS/Colleges/MCS/Department
s/DEE/Faculty/Pages/MuhammadImran.aspx
 Assoc HoD (Sept 2015 onward)

 Teaching Experience
▪ Digital Signal Processing (UG)
▪ Instrumentation and Measurement (UG)
▪ Linear Control Systems (UG & PG)
▪ Adaptive Control (PG)
▪ Linear Circuit Analysis (UG)
▪ Digital Logic Design (UG)
 Text:
▪ Digital Design by M. Morris Mano & Michael D. Ciletti (4th
edition). (Textbook)
▪ M. Morris R. Mano and Michael D. Ciletti, Digital Design: With
an Introduction to the Verilog HDL, VHDL, and System Verilog.
6th Edition, Pearson Education, Inc., 2018.
 Reference:

▪ Floyd, T. L. (). Digital fundamentals (Eleventh ed.) (Ref book)


▪ Mano, M. M., & Kime, C. R. (2008). Logic and computer design
fundamentals (4th ed.). (Ref book)

 Lecture Slides:
▪ Will be provided after the lecture.
TENTATIVE GRADING POLICY:

MIDs : 30%
Final Exam : 50%
Quiz : 10%
Assignments / Project : 10%

MID : 23-27 Aug 2021


Finals : 20-24 Sep 2021
 Copying and cheating
▪ Warning
▪ Graded marks Deduction
 Reproducing Solutions from net
▪ Zero Marks
 Grades
▪ Have to be achieved
▪ Not Given
 Assignments
▪ No delay
 Class Timings
▪ Regular Class –08:00-09:50 Every Mon, Tue & Wed CR-28
▪ Office hours – 10:00-10:50 Every Wednesday
▪ Contact: m.imran@mcs.edu.pk
 Be responsible to get your marks correctly entered in the
result excel sheet.
 Lectures, announcements, and other related material will
be intimated through LMS.
 Course Outlines
Program Learning Outcomes
PLO 1 Engineering Knowledge
An ability to apply knowledge of mathematics, science, engineering fundamentals and an engineering
specialization to the solution of complex engineering problems.
PLO 2 Problem Analysis
An ability to identify, formulate, research literature, and analyze complex engineering problems
reaching substantiated conclusions using first principles of mathematics, natural sciences and
engineering sciences.
PLO 3 Design/Development of Solutions
An ability to design solutions for complex engineering problems and design systems, components or
processes that meet specified needs with appropriate consideration for public health and safety, cultural,
societal, and environmental considerations.
PLO 4 Investigation
An ability to investigate complex engineering problems in a methodical way including literature survey,
design and conduct of experiments, analysis and interpretation of experimental data, and synthesis of
information to derive valid conclusions.
PLO 5 Modern Tool Usage
An ability to create, select and apply appropriate techniques, resources, and modern engineering and IT
tools, including prediction and modeling, to complex engineering activities, with an understanding of
the limitations.
PLO 6 The Engineer and Society
An ability to apply reasoning informed by contextual knowledge to assess societal, health, safety,
legal and cultural issues and the consequent responsibilities relevant to professional engineering
practice and solution to complex engineering problems.
PLO 7 Environment and Sustainability
An ability to understand the impact of professional engineering solutions in societal and
environmental contexts and demonstrate knowledge of and need for sustainable development.
PLO 8 Professional Ethics
Apply ethical principles and commit to professional ethics and responsibilities and norms of
engineering practice.
PLO 9 Individual and Teamwork
An ability to work effectively, as an individual or in a team, on multifaceted and /or multidisciplinary
settings.
PLO 10 Communication
An ability to communicate effectively, orally as well as in writing, on complex engineering activities
with the engineering community and with society at large, such as being able to comprehend and
write effective reports and design documentation, make effective presentations, and give and receive
clear instructions.
PLO 11 Project Management

An ability to demonstrate management skills and apply engineering principles to one’s own
work, as a member and/or leader in a team, to manage projects in a multidisciplinary
environment.
PLO 12 Lifelong Learning

An ability to recognize importance of, and pursue lifelong learning in the broader context of
innovation and technological developments
CLO’s and Mapping with PLO’s
CLO’s PLO Domain Assessment
1 Identify different number systems, their 1 C1 Quiz / Exam
conversions and perform different operations on
them.
2 Analysis and design of combinational and 2 C2 Quiz / Exam
sequential systems using standard gates and
minimization methods
3 3 C2 Quiz / Exam
Analyze the operation of simple synchronous
sequential systems
4 Design and construct combinational systems using 5 P2 Lab
standard gates and minimization methods
 Binary Systems
 Binary Algebra
 Simplification of Boolean Functions
 Combinational Logic
 Sequential Logic
 Sequential Circuits
 Registers and Counters
 Memory and Programable Logic
 Areas of study will include

▪ Introduction to concepts of digital logic, gates, and the digital circuits


▪ Design and analysis of combinational and sequential circuits
▪ Basics of logic design of computer hardware
 Digital System play a prominent role in this digital age
▪ Communication, medical treatment, internet, DVD, CD, etc…
 Digital Computer follow a sequence of instructions, called
programs, that operate on given data
▪ User can specify and change program or data according to needs
 Like Digital Computers, most digital devices are programmable
 Digital Systems have the ability to represent and manipulate
discrete elements of information.
▪ Any set that is restricted to a finite number of elements contains discrete
information
▪ 10 Decimal digits
▪ 26 Alphabet letters
▪ 52 Playing cards
▪ 64 squares of a chessboard
 Digital Systems can do hundreds of millions of operations
per second
 Extreme reliability due to error-correcting codes
 A Digital System is interconnection of digital modules
 To understand Digital module, we need to know about
digital circuits and their logical functions
 7,392= 7x103 + 3x102 + 9x101 + 2x100
▪ Thousands, hundreds, etc…power of 10 implied by
position of coefficient
 Generally a decimal number is represented by a
series of coefficients
▪ a6 a5 a4 a3 a2 a1 a0. a-1 a-2 a-3 a-4
 aj cofficient are any of the 10 digit (0,1,2…9)
 Decimal number are base 10
 Digital Systems manipulate discrete
quantities of information in binary form
▪ Operands in calculations
▪ Decimal Digits
▪ Results
 Strings of binary digits (“bits”)
 Two possible values 0 and 1
 Each digit represents a power of 2
 Coefficient have two possible values 0 and 1
 Strings of binary digits (“bits”)
 Each coefficient aj is multiplied by 2j
 So 101 binary is
1 x 22 + 0 x 21 + 1 x 20
or
1x4 + 0x2 + 1x1=5
 A bit (short for binary digit) is the smallest unit of data
in a computer.
▪ A bit can hold only one of two values: 0 or 1, corresponding to the
electrical values of off or on, respectively.
▪ Because bits are so small, you rarely work with information one bit at a
time
▪ A byte is a unit of measure for digital information.
▪ A single byte contains eight consecutive bits
 Octal is base 8
 A number is represented by a series of coefficients Dec Bin Octal
▪ a6 a5 a4 a3 a2 a1 a0. a-1 a-2 a-3 a-4
0 000 0
 aj cofficient are any of 8 digit (0,1,2…7)
1 001 1
 Need 3 bits for representation
2 010 2
3 011 3
4 100 4
5 101 5
6 110 6
7 111 7
8 1000 -
9 1001 -
Dec Bin Hex
0 0000 0
 Hexadecimal is base 16 1 0001 1
2 0010 2
 A number is represented by a series of 3 0011 3
coefficients
4 0100 4
▪ a6 a5 a4 a3 a2 a1 a0. a-1 a-2 a-3 a-4
5 0101 5
 aj coefficient are any of 16 digit 6 0110 6
(0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F)
7 0111 7
 Need 4 bits for representation 8 1000 8
9 1001 9
10 1010 a
11 1011 b
12 1100 c
13 1101 d
14 1110 e
15 1111 f
 Multiply digit by power of 2
 Just like a decimal number is represented
7 6 5 4 3 2 1 0
27 26 25 24 23 22 21 20
128 64 32 16 8 4 2 1

What is 10011100 in decimal?

1 0 0 1 1 1 0 0

128 + 0 + 0 + 16 + 8 + 4 + 0 + 0 = 156
 Convert 28 decimal to binary

Binary → 11100

7 6 5 4 3 2 1 0
27 26 25 24 23 22 21 20

128 64 32 16 8 4 2 1
 Convert decimal 0.6875 to binary

Integer Fraction Coefficient


0.6875 X 2= 1 + 0.3750 a-1= 1
0.3750 X 2= 0 + 0.7500 a-2= 0
0.7500 X 2= 1 + 0.5000 a-3= 1
0.5000 X 2= 1 + 0.0000 a-4= 1

(0.6875)10 = (0.1011)2
 Convert decimal 153 to Octal

153 = (231)8

3 2 1 0
𝟖𝟑 𝟖𝟐 𝟖𝟏 𝟖𝟎

512 64 8 1
 Convert decimal 0.513 to Octal

Integer Fraction Coefficient


0.513 X 8 = 4 + 0.104 a-1=4
0.104 X 8 = 0 + 0.832 a-2=0
0.832 X 8 = 6 + 0.656 a-3=6
0.656 X 8 = 5 + 0.248 a-4=5
0.248 X 8 = 1 + 0.984 a-5=1
0.984 X 8 = 7 + 0.872 a-5=73)10=
(0.406517)8
(0.513)10 = (0.406517….)8
 Partition Binary number into group of three
digits each
 The corresponding octal digit is then assigned to
each group

 (10 110 001 101 011 . 111 100 000 100)2


 (10 110 001 101 011 . 111 100 000 100)2 = (26153.7404)8
 Each Octal digit is converted to its three digit
binary equivalent

 (26153.7404)8 = (010 110 001 101 011 . 111 100 000 100)2
Bin Hex
0000 0
0001 1
0010 2
0011 3
 Convention – write 0x before number 0100 4
 Hex to Binary –convert digits 0101 5
0110 6
0111 7
0x2ac 1000 8
1001 9
1010 a
0010 1010 1100 1011 b
1100 c
0x2ac = 001010101100 1101 d
1110 e
1111 f
Bin Hex
0000 0
0001 1
0010 2
0011 3
 Just convert groups of 4 bits 0100 4
101001101111011 0101 5
0110 6
0101  0011  0111  1011 0111 7
1000 8
1001 9
5 3 7 b 1010 a
1011 b
1100 c
101001101111011 = 0x537b 1101 d
1110 e
1111 f
Dec Hex
0 0
1 1
2 2
3 3
 Just multiply each hex digit by decimal 4 4
value, and add the results. 5 5

0x2ac 6 6
7 7
8 8
2 • 256 + 10 • 16 + 12 • 1 = 684 9 9
10 a
    11 b
12 c
163 162 161 160
13 d
4096 256 16 1 14 e
15 f
 Binary similar to decimal arithmetic

No carries 1 0 1 1 0 0 Carries
Carries

0 1 1 0 0 1 0 1 1 0
+ 1 0 0 0 1 + 1 0 1 1 1

1 1 1 0 1 1 0 1 1 0 1

1+1 is 2 (or 102), which results in a carry


No borrows 0 0 1 1 0 Borrows

1 0 1 1 0 1 1 1 1 0
- 1 0 0 1 0 - 1 0 0 1 1

0 0 1 0 0 0 1 0 1 1

0 - 1 results in a borrow
Borrow makes it (10)2 =(2) 10
1 0 1 1 Successive additions of
X 1 0 1 multiplicand or zero,
multiplied by 2 (102).
1 0 1 1
Note that multiplication
0 0 0 0 by 102 just shifts bits
1 0 1 1 left.
1 1 0 1 1 1
 Simply Subtraction (Subtraction by addition)
▪ R’s Complement (Radix Complement)
▪ In Binary 2’s complement
▪ In Decimal 10’s complement
▪ (R-1) Complement (Diminished Radix Complement)
▪ In Binary 1’s complement
▪ In Decimal 9’s Complement
 Given a number N in base r having n digits, it is (rn -
1 )-N
 Decimal: (10n -1 )-N
▪ If n=6 then 106-1=1000000-1=999999
▪ 9’s complement of 546700 is 999999-546700=453299
▪ In simple words subtract each digit from 9
 Binary: (2n -1 )-N
▪ If n=4 then 24= (16)10= (10000)2
▪ 24 – 1 = (15)10= (1111)2
▪ Note: 1-0=1 and 1-1 =0 (Bit Changes)
▪ In simple words just change the bits
▪ 1’s complement of 1011000 is 0100111.
 Given a number N in base r having n digits, it is
(rn –N)
 Simply add one to the radix-1 complement
(rn –N) = [(rn -1 )-N] +1

 Decimal:
▪ 2389➔ 7610+1=7611
 Binary: (2n -1 )-N
▪ 101100➔010011+1=010100
 M-N
 Add the minuend, M to r’s complement of
Subtrahend, N
▪ M+ (rn -N)= M-N+ rn
 If M ≥ N then sum will produce end carry rn.
Ignore it result is M-N
 If M ≤ N (No Carry) then take r’s complement
of answer (Negative) result is N-M
 Using 10’s complement subtract 72532-03250

 Using 10’s complement subtract 03250 -72532

 Using 2’s complement subtract 1010100 -1000011

 Using 2’s complement subtract 1000011- 1010100


 Similar to r’s complement
 But since r-1 complement is 1 less than r complement, Carry is
added back to get the result
 If no carry, result is negative➔1’s complement to get the
answer
▪ 1010100-1000011
▪ 1000011-1010100
 Need notation for negative values
 Everything must be represented by binary digits
 Signed magnitude convention
▪ Left most bit can be used
▪ 0 ➔ Positive
▪ 1 ➔ Negative
▪ 01001 is +9 and 11001 is -9 (Not 25. Convention known in advance)
 Signed Complement (Store negative as comps)
▪ Signed 1’s complement (8 bits)➔11110110
▪ Signed 2’s complement (8 bits)➔11110111
▪ Signed Magnitude (8 bits) ➔10001001
 Binary Coded Decimal
 Decimal digits stored in binary
▪ Four bits/digit (Use 10 instead of 16)
▪ Like hex, except stops at 9
▪ Example
931 is coded as 1001 0011 0001
▪ People understand decimal system better
▪ Written differently but decimal value is same
▪ Decimal 15 is BCD 0001 0101 in Binary it was 1111
 Since each digit is max 9 Sum will always be less
than 19= 9+9+1(carry)
 Two BCD digits are added as binary numbers
▪ When binary sum is more than binary (1001)2, result
is invalid (unlike Hex last 6 were ignored)
 Addition of 6=(0110)2 make a correct BCD and
produces a carry
▪ Binary Sum carry and Decimal Carry differ by 16-10=6
 4+5, 4+8, 8+9
 184+576
 4+5, 4+8, 8+9
 184+576
 Binary codes for decimal digits require 4 bits per digit
 Many codes use 4 bits in 10 distinct possible combinations (out of 16)
 2421 and Excess 3 are self complementing (1 and 0➔ 9’s Comp of decimal)
 Contents can be interpreted differently.
 What decimal value does 1100001111001001 represent in different binary codes?
Dec Binary BCD Excess-3 2421 84-2-1 Octal Hexadecimal
0 0 0000 0011 0000 0000 000 0000
1 1 0001 0100 0001 0111 001 0001
2 10 0010 0101 0010 0110 010 0010
3 11 0011 0110 0011 0101 011 0011
4 100 0100 0111 0100 0100 100 0100
5 101 0101 1000 1011 1011 101 0101
6 110 0110 1001 1100 1010 110 0110
7 111 0111 1010 1101 1001 111 0111
8 1000 1000 1011 1110 1000 - 1000
9 1001 1001 1100 1111 1111 - 1001
10 1010 - - - - - 1010 ➔A
11 1011 - - - - - 1011 ➔B …
395 = 0110 1100 1000 (Excess-3 Codes) 9’s Complement
604 = 1001 0011 0111
Gray Code
▪ Only one bit changes at a time
▪ 0000,0001,0011,0010,0110,0111,0101,0100,1100,1
101,1111,1110,1010,1011,1001,1000
▪ Why is this useful?
▪ 0111➔1000 (All Four bits need to be changed)
 ASCII
▪ Many applications require handling of not only numbers but letters
and special characters
▪ Stands for American Standard Code for Information Interchange
▪ 7 Bits to store 128 characters
▪ In ASCII, every letter, number, and punctuation symbol has a
corresponding number, or ASCII code
▪ This encoding system not only lets a computer store a document as
a series of numbers, but also lets it share such documents with
other computers that use the ASCII system.
 Sometimes high-order bit of ASCII coded to
enable detection of errors
 Even parity – set bit to make number of 1’s
even
 Examples
A (1000001) with even parity is 01000001
C (1000011) with even parity is 11000011
 Similar except make the number of 1’s odd
 Examples
A (1000001) with odd parity is 11000001
C (1000011) with odd parity is 01000011
 Note that parity detects only simple errors
▪ One, three, etc. bits
 More complex methods exist
 Some that enable recovery of original info
▪ Cost is more redundant bits
 Physical existence in information storage medium for
storing individual bits
 A binary cell is a device that posses stable stages and is
capable of storing one bit of information
 A Register is a group of binary cells.
▪ Can store any discrete quantity of information that
contains n bits.
▪ 1100001111001001 is a 16 bit register
▪ 2n possible states to store 0 to 2n -1 number
▪ Contents can be interpreted differently
 Basic Operation in digital systems
 When Key is pressed➔ 8 bit alphanumeric
character code in to Input Register
 Contents of Input Register are transferred to
eight least significant cells of a Processor
Register
 After every transfer input register is cleared
for new keystroke
 Each eight bit character transfer to the
processor register is preceded by shift of
previous character to next eight cells on its
left
 When Processor Register is full, its contents
are transferred to the Memory Register
 Adding two 10 bit binary numbers
 Memory Unit
 Processor Unit
 Variables have two possible distinct values, 0
and 1
 Three Logic operations
▪ AND “ . ” If and only if all variable are 1
▪ OR “ + ” If any one or more of the variable is 1
▪ NOT “ ’ ” Complement (Reverse)
 Unlike binary arithmetic 1 +1 is not 10 but 1
 Truth Table of Logical Operations
 Different Digital Systems represent 0 and 1 differently
▪ Logical 0 as 0 volts. Logical 1 as 4 volts
▪ Range
Logic Gates
Logic Gates are electronic circuits that operate on one or more
input signals to produce an output signal
Gates with Multiple Inputs

You might also like