Professional Documents
Culture Documents
Unit 1 Topic 1-Computer Architecture-A En-Us
Unit 1 Topic 1-Computer Architecture-A En-Us
HARACTERISTICS OF
DIGITAL SYSTEMS
The word digital implies that the information in the computer is represented by
variables that take a limited number of discrete values.
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.
A sequence of computer instructions is called a program. The data that are
manipulated by the program constitute the database.
▶ Computer design:
▶ Computer architecture :
It has to do with the structure and behavior of a computer system from the
user's point of view. system
from the user's point of view.
A computer:
▶ It is a high performance digital system.
▶ Itis designed with a modular approach.
▶ It can be considered as a general purpose digital processing system.
It will allow us to understand:
▶ How we can design digital systems that are more energy efficient.
▶ F = X + Y'Z
▶ The relationship between a function and its binary variables can be represented in
a truth table.
▶ F1 = XYZ'
▶ F2 = X + Y'Z
1. Express in algebraic form the truth table relationship between binary variables.
2. Express in algebraic form the Input/Output relationship of logic diagrams.
3. Find simpler circuits for the same function.
BOOLEAN EXPRESSION
▶A Boolean function specified by a truth table can be expressed algebraically in many
different ways.
Analogously, a NAND function can be expressed by (XY)' or (x' + Y'). For this
reason NOR and NAND gates have two different graphical symbols.
EXERCISES
▶ Simplify the following Boolean function using the techniques seen above.
Also draw the gated representation of the function and its reduction.
COMPLEMENT OF A FUNCTION
▶ From Demorgan's theorem we can derive a simple procedure to obtain the
complement of an algebraic expression.
▶ This is done by changing all OR operations to AND operations and all AND
operations to OR operations and then complementing each individual variable .
▶ The input variables of a half adder are called summing and cosuming bits.
The output variables are called summing and cosuming. It is necessary to
specify two output variables because the sum of 1 + 1 is the binary "10",
which has two digits.
▶ We assign the symbols x, y to the two input variables and S(sum) and
C(carry) to the two output variables.
▶ The output S is equal to 1 when only one input is equal to 1 or when all three
inputs are equal to 1.
The storage elements used in clocked sequential circuits are called flip-flops. A flip-
flop is a binary cell capable of storing one bit of information.
▶ It has two outputs, one for the normal value and one for the complementary
value of the bit stored in it. A flip-flop holds a binary state until it is directed by
a clock pulse to change state.
FLIP-FLOP SR
▶ It has three inputs, S(start), R(reset or clear) and C for clock. It has an
output Q, and sometimes it also has a complemented output, which is indicated by
a circuit on the other output terminal.
▶ When the inputs J and K are both equal to 1, a clock transition toggles the flip-flop
outputs to their complementary state.
FLIP-FLOP T
▶ This flip-flop is obtained from JK when the J and K inputs are connected to
provide a single input designated by T. It therefore has only two conditions.
▶ When T=0 (J=K=0) a clock transition does not change the state of the flip-
flop.
T=1 (J=K=1) a clock transition complements the flip-flop state.
FLIP-FLOP SHOT THROUGH THE FLANK
▶ The most common type of flip-flop that serves to synchronize the change of
state during a clock pulse transition is the edge-triggered flip-flop. In this type of
flip-flop, the output transitions occur at a specific level of the clock pulse.
▶ Some flip-flops triggered by the edge have a transition on the falling edge
(positive edge transition) and others cause a transition on the falling edge
(negative edge transition).
EXERCISE
▶ Showthat a JK flip-flop can be converted to a D flip-flop with an inverter
between the J and K inputs.
SEQUENTIAL CIRCUITS
▶A sequential circuit is an interconnection of flip-flops and gates.
▶ The gate by itself constitutes a combinational circuit, but when included
together with the flip-flops, the entire circuit is classified as sequential.
▶ The external outputs of a sequential circuit are functions of both the inputs and the
present state of the flip-flops.
▶ In addition, the next state of the flip-flops is also a function of the present state
and the external inputs.
▶ Determine the output level in Figure 3-24 for A=B=C=1 and D=0.
CHARACTERISTICS OF THE ELEMENTS OF
THE ARCHITECTURE OF THE
COMPUTERS
WHAT IS A DIGITAL COMPUTER?
It is a combination of digital devices and circuits that can perform a programmed
sequence of operations with a minimum of human intervention.
▶ The program is a set of coded instructions that is stored in the internal memory of
the computer with all the data that the program requires.
HOW DO COMPUTERS THINK?
Computers do not think! The programmer provides a program of instructions
and data that specify all the details of what to do, what to do it for, and when to do
it.
▶ A popular saying in the computer field is: "if you put in garbage, you get
garbage".
▶ To make sure no one else gets the information, it is disseminated in 10 different boxes.
Your contact gives you 10 keys along with the following instructions:
1. The information obtained in each box is written in code.
2. Open box number 1 first and execute the instruction contained therein.
3. Continue to check the rest of the boxes in sequence unless instructed otherwise.
8.
7. BOMB (very bad)
20
9. 10.
11 2
ORGANIZATION OF A BASIC COMPUTER SYSTEM
Every computer contains five essential elements or units. The arithmetic logic
unit (ALU), the memory unit, the control unit, the input unit and the output unit.
▶ The data to be used by the ALU can come from the memory unit(arrow 2) or
from the input unit(arrow 3).
▶ The results of operations can be transferred to the memory unit (arrow 4) or to the
output unit (arrow 5).
MEMORY UNIT
The memory also serves as storage of intermediate and final results of
arithmetic operations (arrow 4). The operation of the memory is controlled
by the control unit(arrow 6).
Information can be read from the ALU memory (arrow 2) or from the input unit
(arrow 9).
INPUT UNIT
▶ This unit consists of all the devices that are used to take information and data that
are external to the computer and place them in the memory unit(arrow 8)
or the ALU(arrow 3).
▶ The control unit determines where the input information is sent to (arrow
10).
▶ The output devices are driven by the control unit(arrow 12) and can receive
data from the memory la(arrow 9) or from the ALU(arrow 5).
The control unit extracts the instruction from memory by sending an address
(arrow 7) and a read command (arrow 6) to the memory unit.
▶ The main instruction word stored in the memory location is then transferred to the
control unit(arrow 11).
CENTRAL PROCESSING UNIT (CPU)
▶ In Figure 13-2 the ALU and the control unit are shown combined into the
so-called central processing unit or CPU. The above is commonly done to
separate the brains of the computer from other units.
▶ Generally the microprocessor is a single IC that contains all the circuitry for the
control and arithmetic logic units.
The RAM section consists of one or more LSI circuits connected to provide the
designed memory capacity. This memory section is used to store programs
and data, which will change frequently during the course of operation.
▶ The ROM section consists of one more ROM circuits for storing instructions
and unchanging data.
THE MICROPROCESSOR (MPU)
▶ The MPU is the heart of any computer. It performs many functions, including:
1. Provide control and timing signals for all elements of the microcomputer.
2. Extract instructions and data from memory.
3. Transfer data to and from memory and input/output devices.
4. Decoding instructions.
5. Execute the arithmetic and logical operations invoked by the instructions.
6. Respond to control signals generated at the input/output such as
RESET and INTERRUPTION.
▶ The MPU contains all the logic circuitry necessary to perform the above
functions but, in general, there is no way to access the internal logic.
Instead, we can control what happens inside the MPU by means of a program
consisting of several instructions, which is placed in memory for the MPU to
execute.
When we want to change its operation, we only change the programs stored
in RAM (software) or recorded in ROM (firmware) instead of changing the
electronics (hardware).
▶ The internal logic of the MPU is very complex, but it can be considered as
consisting of three basic sections: the control and timing section , the register
section and the ALU .
▶ The main function of control and timing is to fetch from memory and
decode (interpret) the instructions in memory that are part of a program, and then
generate the control signals needed to execute the instructions.
The register section contains several registers (inside the MPU), each of which has
a special function. The most important of these is the program counter
(PC), which holds the address where the next instruction to be fetched from
memory is located.
▶ For this reason, the main unit of information in a computer is a group of bits
which are given the name word .
The number of bits that make up the word is called the word size.
The word size is a way of describing a computer. It is common for computers
to be described in terms of their word size, such as 8-bit computers, 16-bit
computers, and so on.
▶ For example, a 16-bit computer is one in which instructions and data are stored in
memory in 16-bit units and processed by the CPU also in 16-bit units.
▶ These can be found in many formats, including signed and unsigned binary
representations, BCD, ASCII code for characters, among others.
▶ Here is an example of how the number 86 is stored in an 8-bit word.10
:
01010110
▶ The following example shows how the ASCII code corresponding to the
character "V" is stored in an 8-bit word.
01010110
It is the programmer's responsibility to know what type of data is being stored in
memory and to ensure that the program interprets and processes the data
appropriately.
▶ Words that store instructions are more complex than words that only contain
data.
REVIEW QUESTIONS
What are the types of information stored in the words of a computer?
What are the advantages of a computer that has a larger word size?
WORDS OF INSTRUCTION
▶ The format used with data words varies only slightly between different
computers, especially those with the same word size.
However, the same is not true for the format of instruction words. These words
contain the information necessary for a computer to execute its various
operations, the format and code of these can vary widely from one computer to
another.
▶ But, for most computers, instruction words carry two basic units of information: the
operation to be performed and the address of the operand (data) to be operated
on.
▶ Figure 13-6 shows an example of a hypothetical 20-bit computer
instruction word. The 20 bits of the instruction word are divided into two
parts.
▶ The first part of the word (bits 16 through 19) contains the operation code
(op code, for short). The 4-bit op code represents the operation that the computer
is being asked to perform, such as addition or subtraction. The second part (bits 0
through 15) is the operand address, which represents the location in which the
computer is being
memory where the asked to is
operand perform
stored.the operation.
▶ With 4 bits being used for the op code, there are 24 = 16 different possible codes,
where each indicates a different instruction. This means that a computer
using this instruction word format is limited to 16 different possible instructions
that can be executed.
The op code 0100 represents one of the 16 possible operations; let's assume it
is the ADD code. The address code is 0101101001110010 or more
appropriately, 5A72 in hexadecimal. In fact this complete instruction word can be
expressed as
▶ This complete instruction word therefore instructs the computer to do the
following:
Extract the data stored in address location 5A72, send it to the ALU, and add
it to the number in the accumulator register. The sum is then stored in the
accumulator (the previous contents of the accumulator are lost).
▶ The first two-byte instruction byte in an op code and the second is an 8-bit
address code that specifies the memory location of the operand. In the
three-byte instruction, the second and third bytes form a 16-bit op address. For
these multibyte instructions, the two or three bytes that make up the entire
instruction have to be stored in successive memory locations.
▶ This is illustrated in Table 13-1 for a three-byte instruction. The columns on the
left provide the address locations in memory where each byte (word) is stored.
These addresses are given in hexadecimal code. The second column of the
binary word as actually stored in memory; in the third column is the hex
equivalent of that word. Examine this example in its entirety before continuing and
try to imagine what it represents.
▶ The three bytes stored in locations 0020, 0021 and 0022 constitute in the complete
instruction to add the data word stored in address location 35F6 to the
accumulator. The second and third bytes contain the 8 low-order bytes (LO), the 8
high-order bits (HI), respectively of the operand address.
The op code byte is 3A which is the code for the operation to load the
accumulator into the 8085 microprocessor. Memory location 35F6 is also shown;
its contents are the data word (7C) that the computer control unit will extract and
send to the ALU for addition.
REVIEW QUESTIONS
What is an operation code?
The instruction words we have been describing are called machine language
instructions because they are represented by ones and zeros, the only
language the machine (computer) understands. Many other languages can be
used to program a computer and the student may be familiar with some of them,
such as BASIC or Pascal. These low-level languages are designed to make
it easier to write a program.
1. Loads the accumulator with data from the memory of address 0300.
2. Subtract 1 from these data.
3. If the result of the subtraction is zero, the program stops. Otherwise, the result is
stored again at address 0300 and the program stops.
▶ Table 13-3 shows the complete program as it would be produced in
computer memory. Actually, the first two columns are the program in
machine language; the other information is included for descriptive
purposes. The first column gives the hex address of each memory location used
by the program. The second column gives the hex equivalent of the word stored in
each memory location. Remember that the hex values represent the actual binary
addresses and instruction codes that the computer understands.
The third column gives the mnemonic and operand address (if any)
associated with each instruction. The last column describes the operation
performed by each instruction.
▶ For example the first instruction of the program is a three-byte instruction. The
first byte stored at memory address 0000 is the op code 3A. The second and
third bytes stored at addresses 0001 and 0002 represent the address of
operand 0300. The mnemonic for this instruction is LDA $0300. LDA is the
abbreviation for the accumulator load operation and $0300 is the address of
the operand. The $ sign is often used to indicate that the address is
represented in hex. When the computer executes this instruction it will read the
8-bit data that is stored at location 0300 and load it into the accumulator.
The program starts at address 0000 and ends at 000A. The address location
0300 is used to store data. The contents of the latter locations are not given
because they will generally be variable. The address locations between 000A and
0300 are not used.
PROGRAM EXECUTION