You are on page 1of 78

Chapter 1

Introduction to Digital Systems


1.1 Digital Computers

Digital computer - a digital system that performs various


computational tasks.
•The word “digital” implies that the information in the
computer is repre­sented by variables that take a limited
number of discrete values.
•These values are processed internally by components that
can maintain a limited number of discrete states.
•Digital computers use the binary number system, which has
two digits: 0 and 1.
•A binary digit is called a bit. Information is represented in
digital computers in groups of bits.

2
Cont….

• By using various coding techniques, groups of bits can be


made to represent not only binary numbers but also other
discrete symbols, such as decimal digits or letters of the
alphabet.
• A computer system is subdivided into two functional entities:
hardware and software.

3
Cont….

• Computer Hardware
▪ CPU
▪ Memory
• Program Memory(ROM) Memory
• Data Memory(RAM)
▪ I/O Device
• Interface: 8251 SIO, 8255 PIO….. CPU
• Input Device: Keyboard, Mouse,
Scanner

• Output Device: Printer, Plotter, Display Input Output


Device
IOP Device
• Storage Device(I/O): FDD, HDD,
Figure 1-1 Block Diagram of a
digital Computer
4
Cont….

• Program(S/W)
▪ A sequence of instruction Application S/W
▪ S/W = Program + Data
• The data that are manipulated by the
API
program constitute the data base
• Application S/W Operating System
▪ DB, word processor, Spread Sheet
• System S/W
▪ Consist, collection of software whose
ROM BIOS

purpose is more effective usage of Computer H/W


computers.
– OS, Firmware, Compiler, Device
Driver
5
Cont….

• Computer organization
▪ Encompasses all physical aspects of computer systems.
E.g., control signals, memory types.
▪ Become familiar with how various circuits and
components fit together to create working computer
systems.
▪ How does a computer work?
• Computer Architecture
▪ Logical aspects of system implementation as seen by the
programmer.
▪ Structure and behavior of the computer system.
▪ Hardware Components + ISA(Instruction set architecture)
6
Cont….

“Hardware Components”
- CPU(Control, Data path), Memory, I/O devices
“ISA”?
- Instructions, Addressing modes, Instruction and data
formats
▪ How do I design a computer?
Why we study computer organization and architecture?
▪ Design better programs, including system software such as
compilers, operating systems, and device drivers.
▪ Optimize program behavior.
▪ Evaluate (benchmark) computer system performance.
▪ Understand time, space, and price tradeoffs.
7
Cont….

Example
•IBM(International Business Machines Corporation), SUN and
Intel ISAs, it is possible to purchase processors which execute
the same instructions from more than one manufacturer
•All these processors may have quite different internal
organizations but they all appear identical to a programmer,
because their instruction sets are the same
•Organization & Architecture enables a family of computer
models
▪ Same Architecture, but with differences in Organization
▪ Different price and performance characteristics.

8
1.2 The Computer Level Hierarchy

• Computers consist of many things besides chips.


• Before a computer can do anything worthwhile, it must
also use software.
• Writing complex programs requires a “divide and
conquer” approach, where each program module solves a
smaller problem.
• Complex computer systems employ a similar technique
through a series of virtual machine layers.

9
Cont….

• Each virtual machine layer


is an abstraction of the level
below it.
• The machines at each level
execute their own particular
instructions, calling upon
machines at lower levels to
perform tasks as required.
• Computer circuits
ultimately carry out the
work.

10
Cont….

Level 6: The User Level


▪ Program execution and user interface level.
▪ The level with which we are most familiar.
▪ Run like word processors, graphics package programs or
games.
Level 5: High-Level Language Level
▪ The level with which we interact when we write
programs in languages such as C, Pascal, Lisp, and Java.
▪ Languages translated (with compiler or interpreter) to a
language the machine can understand.
11
Cont….

Level 4: Assembly Language Level


▪ Acts upon assembly language produced from Level 5,
as well as instructions programmed directly at this
level.
Level 3: System Software Level
▪ Deals with operating system instructions
▪ Controls executing processes on the system.
▪ Protects system resources.
▪ instructions translated from assembly language to
machine language are passed through this level
unmodified.
12
Cont….

Level 2: Machine Level


▪ Also known as the Instruction Set Architecture (ISA) Level.
▪ Consists of instructions that are particular to the
architecture of the machine.
▪ Programs written in machine language need no compilers,
interpreters, or assemblers.
Level 1: Control Level
▪ A control unit makes sure that instructions are decoded and
executed properly and that data is moved where and when
it should be. Control units can be microprogrammed or
hardwired.
▪ A microprogram is a program written in a low-level language that
is implemented by the hardware.
13
Cont….

▪ Hardwired control units consist of hardware that directly


executes machine instructions.
▪ Machine instructions produced in level-2 are fed into
this microprogram, which interprets the instructions by
activating hardware suited to execute the original
instruction.
Level 0: Digital Logic Level
▪ This level is where we find digital circuits (the chips).
▪ Digital circuits consist of gates and wires.
▪ These components implement the mathematical logic
of all other levels.

14
1.3 Von Neumann Model

• On the ENIAC, all programming was done at the digital


logic level.
• Programming the computer involved moving plugs and
wires.
• A different hardware configuration was needed to solve
every unique problem type.

Configuring the ENIAC to solve a “simple” problem


required many days labor by skilled technicians.

15
Cont….

• Inventors of the ENIAC, John Mauchley and J.Presper


Eckert, conceived of a computer that could store
instructions in memory.
• The invention of this idea has since been ascribed to a
mathematician, John von Neumann, who was a
contemporary of Mauchley and Eckert.
• Stored-program computers have become known as von
Neumann Architecture systems.

16
Cont….

• Today’s stored-program computers have the following


characteristics:
Three hardware systems:
• A central processing unit (CPU)
• A main memory system
• An I/O system
• The capacity to carry out sequential instruction
processing.
• A single data path between the CPU and main memory.
▪ This single path is known as the von Neumann
bottleneck.

17
Cont….

• This is a general
depiction of a
von Neumann
system:

• These computers
employ a fetch-
decode-execute
cycle to run
programs as
follows . . .

18
Cont….

• The control unit fetches the next instruction from


memory(RAM) using the program counter to determine
where the instruction is located.
• Control unit accesses instructions in sequence.

19
Cont….

• The instruction is decoded into a language that the ALU can


understand (decoded by the control unit)

20
Cont….

• Any data operands required to execute the instruction are


fetched from memory and placed into registers within the
CPU.

21
Cont….

• The ALU executes the instruction and places results in registers


or memory.
• Finally instructions are stored in the main memory.

22
1.4 Non-Von Neumann Model

• Conventional stored-program computers have


undergone many incremental improvements over the
years.
• These improvements include adding specialized buses,
floating-point units, and cache memories, to name only
a few.
• But enormous improvements in computational power
require departure from the classic von Neumann
architecture.
• Adding processors is one approach.

23
Cont….

• In the late 1960s, high-performance computer systems


were equipped with dual processors to increase
computational throughput.
• In the 1970s supercomputer systems were introduced
with 32 processors.
• Supercomputers with 1,000 processors were built in
the 1980s.
• In 1999, IBM announced its Blue Gene system
containing over 1 million processors.

24
Cont….

• Parallel processing is only one method of providing


increased computational power.
• More radical systems have reinvented the fundamental
concepts of computation.
• These advanced systems include genetic computers,
quantum computers, and dataflow systems.
• Data can be fetched at the same time.

25
1.5 Logic Gates and Boolean Algebra

• The manipulation of binary information is done by logic


circuit called “gate”.
• Gates are blocks of hardware that produce signals of
binary 1 or 0 when input logic requirements are satisfied.

26
Cont….

27
Cont….

• In the latter part of the nineteenth century, George Boole


incensed philosophers and mathematicians alike when he
suggested that logical thought could be represented through
mathematical equations.
– How challenge anyone suggest that human thought
could be encapsulated and manipulated like an
algebraic formula?
• Computers, as we know them today, are implementations of
Boole’s Laws of Thought.

28
Cont….

• Boolean Algebra
▪ is an algebra for the manipulation of
objects that can take only two values.
▪ Deals with binary variable(A, B, x, y: T/F
or 1/0) + logic operation(AND, OR,
NOT…) 2 Combination
n

x y z F
Variable n = 3
• Boolean Function: described by an 0 0 0 0
0 0 1 1
algebraic expression consisting of binary 0 1 0 0
variables, the constants 0 and 1, and the logic 0 1 1 0
1 0 0 1
operation symbols +, . , ’ 1 0 1 1

▪ F(x, y, z) = x + y’z
1 1 0 1
1 1 1 1
• The relationship between a function and its
binary variables can be represented in a truth 29
table.
Cont….

• To represent a function in a truth table we need a list of the


2n combinations of n binary variables.
• A Boolean function can be transformed from an algebraic
expression into a logic diagram composed of AND, OR,
and inverter gates.

30
Cont….

• Purpose of Boolean Algebra


▪ To facilitate the analysis and design of digital circuit.
Convenient Tools
▪ Truth table : relationship between binary variables
▪ Logic diagram : input-output relationship
▪ Find simpler circuits for the same function
• Digital computers contain circuits that implement Boolean
functions.
• The simpler that we can make a Boolean function, the
smaller the circuit that will result.
▪ Simpler circuits are cheaper to build, consume less
power, and run faster than complex circuits.
31
Cont….

• With this in mind, we always want to reduce our Boolean


functions to their simplest form.
• There are a number of Boolean identities that help us to do this.

32
Table: Basic Identities of Boolean Algebra
Cont….

Examples:

• We can use Boolean identities to simplify the function:

33
Cont….

❖ F= AB’ + C’D + AB’ + C’D


= x + x (let x= AB’ + C’D)
=x
= AB’ + C’D
❖ F= ABC + ABC’ + A’C
= AB(C + C’) + A’C
= AB + A’C

Figure : Two logic diagrams for the same Boolean function. 34


Cont….

Boolean functions can also be expressed in standardized or


canonical form.
•There are two canonical forms for Boolean expressions:
sum-of-products and product-of-sums.
❖Recall the Boolean product is the AND operation
and the Boolean sum is the OR operation.
•In the sum-of-products form, ANDed variables are
ORed together.
For example:
•In the product-of-sums form, ORed variables are
ANDed together:
For example: 35
Cont….

• It is easy to convert a function to


sum-of-products form using its
truth table.
• We are interested in the values of
the variables that make the
function true (=1).
• Using the truth table, we list the
values of the variables that result
in a true function value.
• In each product term, you must
then complement any variables
that are 0 for that row.
• Each group of variables is then
36
ORed together.
Cont….

• The sum-of-products for our function is:

We note that this function is not


in simplest terms. Our aim is
only to rewrite our function in
canonical sum-of-products form.

37
Cont….

DeMorgan’s law – it provides an easy way of finding the


complement of a Boolean function.
Recall DeMorgan’s law:

•Replace each variable by its complement and change all


ANDs to ORs and all ORs to ANDs.
•Thus, we find the complement of:

38
Cont….

Map Simplification
•Karnaugh Map(K-map)-is map method for simplifying
Boolean expressions.(graphical representation)
•is a matrix consisting of rows and columns that represent the
output values of a Boolean function.
•The output values placed in each cell are derived from the
minterms of a Boolean function.
•A minterm is a product term that contains all of the
function’s variables exactly once, either complemented or not
complemented.

39
Cont….

• For example, the minterms for a function having the inputs


x and y are:
• Consider the Boolean function,
• Its minterms are:

40
Cont….

• Similarly, a function having three inputs, has the minterms


that are shown in this diagram.

41
Cont….

• A K-map has a cell for each


minterm.
• This means that it has a cell for
each line for the truth table of a
function.
• The truth table for the function
F(x,y) = xy is shown at the right
along with its corresponding K-
map.

42
Cont….

• As another example, we give the


truth table and K-map for the
function, F(x,y) = x + y at the
right.
• This function is equivalent to OR
of all of the minterms that have a
value of 1. Thus:

43
Cont….

• We reduce our complicated expression to its simplest


terms by finding adjacent 1s in the Kmap that can be
collected into groups that are powers of two.
• In our example, we have two such groups.
▪ Can you find them?

• The best way of selecting two groups of 1s from our


simple Kmap is shown below.
• We see that both groups are powers
of two and that the groups overlap.
44
Cont….

The rules of Kmap simplification are:


• Groupings can contain only 1s; no 0s.
• Groups can be formed only in the same row or in the
same column (diagonal groups are not allowed).
• The number of 1s in a group must be a power of 2 even
if it contains a single 1.
• The groups must be made as large as possible.
• Groups can overlap and wrap around the sides of the
Kmap.

45
Cont….

• A Kmap for three variables is constructed as shown in the


diagram below.
• We have placed each minterm in the cell that will hold its
value.
Notice that the values for the yz combination at the top of
the matrix form a pattern that is not a normal binary
sequence. (The input values for the Kmap must be
ordered so that each minterm differs in only one variable
from each neighbor)

46
Cont….

• Thus, the first row of the Kmap contains all minterms


where x has a value of zero.
• The first column contains all minterms where y and z both
have a value of zero.

47
Cont….

• Consider the function:

• Its Kmap is given below.


▪ What is the largest group of 1s that is a power of 2?

48
Cont….

• This grouping tells us that changes in the variables x and y


have no influence upon the value of the function: They are
irrelevant.
• This means that the function,

reduces to F(x) = z.

49
Cont….

• Now for a more complicated Kmap. Consider the


function:

• Its Kmap is shown below. There are (only) two groupings


of 1s.
▪ Can you find them?

50
Cont….

• In this Kmap, we see an example of a group that wraps


around the sides of a Kmap.
• This group tells us that the values of x and y are not
relevant to the term of the function that is encompassed by
the group.
❖ What does this tell us about this term of the function?

What about the


green group in
the top row?

51
Cont….

Recall that we had


six minterms in our
original function!

52
Cont….

• Our model can be extended to accommodate the 16


minterms that are produced by a four-input function.
• This is the format for a 16-minterm Kmap.

53
Cont….

• We have populated the Kmap shown below with the


nonzero minterms from the function:

▪ Can you identify (only) three groups in this Kmap?

Recall that
groups can
overlap.

54
Cont….

• Our three groups consist of:


▪ A purple group entirely within the Kmap at the
right.
▪ A pink group that wraps the top and bottom.
▪ A green group that spans the corners.
• Thus we have three terms in our final function:

55
1.6. Common digital components

Integrated Circuits
• is a small silicon semiconductor crystal called a chip ,
containing the electronic components for the digital
gates.
•The various gates are interconnected inside the chip to form
the required circuit.
•IC’s are the tiny electronics circuit used to perform the
several operations like Amplifier, timer, counter, oscillator,
microcontroller or a computer memory.

56
Cont….

• As the technology of ICs has improved, the number of


gates that can be put in a single chip has increased
considerably.
• The differentiation between those chips that have a few
internal gates and those having hundreds or thousands
of gates is made by a customary reference to a package
as being either a small, medium, or large-scale
integration device.
❖ SSI(Small Scale Integration Device)-contain several
independent gates in a single package. The inputs and
outputs of the gates are connected directly to the pins in
the package. The number of gates is usually less than 10
and is limited by the number of pins available in the IC.
57
Cont….

❖ MSI(Medium-scale integration)- have a complexity of


approximately 10 to 200 gates in a single package. They
usually perform specific elementary digital functions such
as decoders, adders, and registers.
❖ LSI (Large-scale integration) - contain between 200 and a
few thousand gates in a single package. They include
digital systems, such as proces­sors, memory chips, and
programmable modules.
❖ VLSI(Very Large Scale Integration)- contain thousands of
gates within a single package. Examples are large
memory arrays and complex microcomputer chips.

58
Cont….

Registers
•is a group of flip-flops with each flip-flop capable of
storing one bit of information.
•They can be implemented using D flip-flops.
•One D flip-flop is equivalent to a 1-bit register, so a
collection of D flip-flops is necessary to store multi-bit
values.
▪ A 32-bit register requires 32 D flip-flops.
▪ These collections of flip-flops must be clocked to work in
unison. At each pulse of the clock, input enters the register
and cannot be changed (and thus is stored) until the clock
pulses again.
59
Cont….

Binary Counter
•It goes through a predetermined sequence of states as the
clock pulses.(follows the binary number sequence )
•Counters are found in almost all equipment containing
digital logic.
•They are used for counting the number of occurrences of an
event and are useful for generating timing signals to control
the sequence of operations in digital computers.

60
Cont….

Memory Units
• is a collection of storage cells together with associated
circuits needed to transfer information in and out of storage.
•It stores binary information in groups of bits called words.
•A memory word is a group of l's and 0's and may
represent a number, an instruction code, one or more
alphanumeric characters, or any other binary-coded
information.

61
1.7. Combinational Circuits

• A connected arrangement of logic gates with a set of


inputs and outputs.
• It produces a specified output at the instant when input
values are applied.

i0 f0
i1 Combinational f1
Circuits
...

(Logic Gates)

...
in fm

62
Design Example

Half-Adder
▪ The most basic digital arithmetic circuit is the addition of
two binary digits.
▪ A combinational circuit that performs the arithmetic
addition of two bits is called a half-adder.

63
Cont….

Full Adder
▪ We can change our half adder into to a full adder by
including gates for processing the carry bit.
▪ Full adder is a combinational circuits that forms the
arithmetic sum of three input bit(Carry considered).

64
Cont….

Decoder
▪ a combinational circuit that converts binary information
from the n coded inputs to a maximum of 2n unique
outputs.
▪ Decoders have a wide variety of applications in digital
systems such as data demultiplexing, digital display, digital to
analog converting, memory addressing.

This is a block
diagram for a
decoder.
65
Cont….

• This is what a 2-to-4 decoder looks like on the inside.

If x = 0 an y = 1,
which output line
is enabled?

66
Cont….

Multiplexer(data selector)
▪ It selects a single output from several inputs.
▪ The particular input chosen for output
is determined by the value of the
multiplexer’s control lines.
▪ The term multiplex means “many into one.

67

Fig: 4 to 1 Multiplexer
1.8. Sequential Circuits
• A sequential circuit is an interconnection of F/F and Gate

Combinational Circuit = Gate


Sequential Circuit = Gate +
Combinatio
Input F/F
nal Output
Flip-
Circuit
Flops
Clock

Sequential circuits are broadly classified into two main categories,


known as synchronous or clocked and asynchronous or
unclocked sequential circuits, depending on the timing of their
signals.
▪ synchronous sequential circuit
Is a sequential circuit whose behavior can be defined from the knowledge
of its signal at discrete instants of time. 68
Cont….

In these systems, the memory elements are affected only at


discrete instants of time.
•The synchronization is achieved by a timing device known
as a system clock.
•State changes are controlled by clocks.
▪ A “clock” is a special circuit that sends electrical pulses
through a circuit.
•Clocks produce electrical waveforms such as the one shown
below

69
Cont….

▪ Asynchronous sequential circuit


• Is a sequential in which they become active the moment
any input value changes. (The output will be affected
whenever the input changes)
• There is no need to wait for a clock pulse.
• Asynchronous circuits are faster than synchronous
sequential circuits. However, in an asynchronous circuit,
events are allowed to occur without any
synchronization. And in such a case, the system
becomes unstable.
• Since the designs of asynchronous circuits are more
tedious and difficult, their uses are rather limited.
70
Cont….

• In clocked sequential circuits, the transition from present


state to next state is activated by the presence of a
clock signal.
• Circuits can change state on the rising edge, falling edge, or
when the clock pulse reaches its highest voltage.

• Circuits that change state on the rising edge, or falling edge


of the clock pulse are called edge-triggered.
• Level-triggered circuits change state when the clock voltage
reaches its highest or lowest level.
71
Cont….

• To retain their state values, sequential circuits rely on


feedback.
• Feedback in digital circuits occurs when an output is
looped back to the input.
• A simple example of this concept is shown below.
– If Q is 0 it will always be 0, if it is 1, it will always be1.
Why?

72
Cont….

Flip-Flop
▪ The storage elements employed in clocked sequential
circuit which are capable of storing binary information.
▪ It can have only two states, either the 1 state or the 0
state.

▪ The state of Q is called the state of the flip-flop,


whereas the state of Q' is called the complementary state
of the flip-flop.

73
Cont….

▪ The two outputs are complementary to each other. If Q is


1 i.e., Set, then Q' is 0; i.e., Reset, then Q' is 1. That
means Q and Q' cannot be at the same state
simultaneously. If it happens by any chance, it violates the
definition of a flip-flop and hence is called an undefined
condition.
The most common types of flip-flops are presented
below.
❖SR Flip-Flop

74
Cont….

• The behavior of an SR flip-flop is described by a


characteristic table.
• Q(t) means the value of the output at time t. Q(t+1) is the
value of Q after the next clock pulse.
• We can describe any flip-flop by using a characteristic
table, which indicates what the next state should be based
on the inputs and the current state

75
Cont….

• The SR flip-flop actually


has three inputs: S, R, and
its current output, Q.
• Thus, we can construct a
truth table for this circuit,
as shown at the right.
• Notice the two undefined
values. When both S and
R are 1, the SR flip-flop is
unstable.

The SR flip-flop should not be pulsed when


S = R = 1 since it produces an indeterminate next state . 76
Cont….

JK Flip-Flop
•The SR flip-flop can be modified to provide a stable state when
both inputs are 1.
This modified flip-flop is called a JK flip-flop, shown at the right.(“JK”
is in honor of Jack Kilby)

Fig: Modified SR flip-flop

•The characteristic table indicates that


the flip-flop is stable for all inputs. 77
Cont….

D Flip-Flop • The D flip-flop is the


•the output of the flip-flop fundamental circuit of
remains the same during computer memory.
subsequent clock pulses. ▪ D flip-flops are usually
•The output changes only illustrated using the
when the value of D changes. block diagram shown
below.

78

You might also like