Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
87 views

Computer Architecture Notes

1. The internal organization of a computer refers to how it handles and processes data through registers, microoperations, and control signals. Registers store data and have specific jobs. Microoperations are basic operations like loading, clearing, and shifting data within registers. Control signals coordinate microoperations to perform tasks. 2. At the register transfer level, a computer's inner workings are examined through its registers, the data transformations within registers via microoperations, and how data moves between registers. 3. Register transfer language is a symbolic notation for describing a computer's internal organization, including register designations and how data is transferred between registers via parallel loading and control signals.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
87 views

Computer Architecture Notes

1. The internal organization of a computer refers to how it handles and processes data through registers, microoperations, and control signals. Registers store data and have specific jobs. Microoperations are basic operations like loading, clearing, and shifting data within registers. Control signals coordinate microoperations to perform tasks. 2. At the register transfer level, a computer's inner workings are examined through its registers, the data transformations within registers via microoperations, and how data moves between registers. 3. Register transfer language is a symbolic notation for describing a computer's internal organization, including register designations and how data is transferred between registers via parallel loading and control signals.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 45

Chapter 1: Register Transfer and Microoperations

Computer ?

A computer is a machine or device that performs processes, calculations and operations based on
instructions provided by a software or hardware program. It has the ability to accept data (input),
process it, and then produce outputs.

Simple Digital System:

Combinational and sequential circuits can be used to create simple digital systems. These are the
low-level building blocks of a digital computer.
Simple digital systems are frequently characterized in terms of the registers they contain, and

the operations that they perform. Typically, What operations are performed on the data in the
registers What information is passed between registers

Microoperations:

Microoperations are the tiny, fundamental operations that happen within registers in a computer.
Think of them as the basic building blocks for handling data inside registers.

Here are some common examples of microoperations:

1. Shift: Shifting means moving the bits (0s and 1s) within a register to the left or right. It's like
rearranging the order of items in a line. This can be useful for things like scrolling text or
adjusting the position of binary data.

2. Load: Loading means putting new


data into a register. It's like filling a
glass with water. When a register
loads data, it replaces the old
information with the new.

3. Clear: Clearing a register means


erasing or resetting all the data inside
it, making it empty. It's like wiping a
whiteboard clean. This is useful when you want to start with a fresh, empty register.

4. Increment: Incrementing is like adding 1 to a number. It increases the value stored in a


register by 1. This can be handy for tasks like counting or keeping track of things.

In summary, microoperations are small but crucial operations that happen within registers. They
include shifting data around, loading new data, clearing out old data, and incrementing values. These
microoperations are the nuts and bolts that help registers manage and process information
efficiently in a computer system.
Let's break down the organization of a digital system, including registers, microoperations, and
control signals, in a clear and concise manner:

1. Definition of Internal Organization of a Computer: The internal organization of a computer refers


to how it is structured on the inside, specifically in terms of how it handles and processes data. It
encompasses several key elements:

a. Set of Registers and Their Functions: Registers are like tiny, super-fast storage units inside a
computer. Each register has a specific job. For instance:

• Data Registers hold information temporarily.

• Address Registers store memory addresses.

• Program Counter keeps track of which instruction to execute next.

b. Microoperations Set: Microoperations are the basic, fundamental operations that happen within
these registers. They include actions like:

• Load: Putting new data into a register.

• Clear: Wiping out all the data in a register.

• Add: Adding numbers together.

• Shift: Moving bits left or right.

c. Control Signals: Control signals are like the conductor's baton in an orchestra. They initiate and
coordinate the sequence of microoperations. When a computer needs to perform a specific task,
control signals orchestrate which microoperations happen in what order. It's like a series of well-
choreographed steps.

For example, if you want to add two numbers stored in registers, the control signals will tell the
computer to:

• Load the numbers from registers into the arithmetic unit.

• Perform the addition.

• Store the result back in a register.

In summary, the internal organization of a computer is like an intricate dance. Registers hold data
and have specific jobs. Microoperations are the basic moves, and control signals are the cues that
guide the dance, ensuring everything happens in the right order to perform tasks efficiently and
accurately.

Register Transfer Level (RTL): When we look at a computer or any digital system from an RTL
perspective, we're zooming in on three crucial aspects:

1. The System's Registers: These are like the tiny, high-speed storage units within the
computer. Each register has a specific job, like holding data temporarily or storing addresses.

2. The Data Transformations: At the RTL, we're keenly focused on what happens to the data
inside these registers. It's like watching how numbers change and transform, whether
they're added, subtracted, or shifted around.
3. The Data Transfers: We pay close attention to how data moves between registers. Think of
this as tracking how information travels from one storage unit to another, like data moving
from memory to a processing unit.

In essence, Register Transfer Level is like getting up close and personal with a computer's inner
workings. It's all about registers, the transformations happening within them, and the way data
flows between them. This level of detail helps us understand how a digital system really operates.

Register Transfer Language (RTL): Instead of describing a digital system using plain words, we use a
specific notation called Register Transfer Language (RTL). It's like having a dedicated language for
talking about how a computer works internally.

Key Points:

1. Symbolic Language: RTL is a symbolic language, which means it uses symbols, codes, and
notations to represent actions and operations inside a digital system. It's like having a secret
code that only computer designers understand.

2. Describing Internal Organization: RTL is a handy tool for describing how the inside of a
digital computer is organized. It helps us explain what each part does and how they work
together, much like a blueprint for understanding a complex machine.

3. Facilitating Design: Not only does RTL help explain existing digital systems, but it's also
incredibly useful for designing new ones. Designers can use RTL to plan out how a digital
system will function before it's even built, like drawing a detailed map before going on a
journey.

Designation of Registers:

• Registers in a computer system are typically designated by capital letters, and sometimes
numbers may follow (e.g., A, R13, IR).

• These designations often hint at their functions or purpose within the system.

Examples:

• MAR (Memory Address Register): This register is responsible for holding memory addresses,
so it's labeled accordingly.

• PC (Program Counter): The PC keeps track of the next instruction to be executed in a


program.

• IR (Instruction Register): The IR stores the current instruction being executed.

• Registers and their contents can be viewed and represented in various ways

– A register can be viewed as a single entity

– Registers may also be represented showing the bits of


data they contain
Register Transfer:

• Register transfer refers to the process of copying the contents of one register to another.

• It's often represented as: R2 ← R1, which means that the data in register R1 is copied
(loaded) into register R2.

• During this operation, all bits from the source register R1 are simultaneously transferred to
the destination register R2, typically occurring in a single clock pulse.

Key Points:

• Simultaneous Transfer: Register transfer involves moving all the bits from one register to
another at the same time. It's like pouring the contents of one glass into another in one swift
action.

• Non-Destructive: Importantly, this process doesn't alter or destroy the data in the source
register (R1). It simply duplicates it into the destination register (R2), allowing both registers
to hold the same information.

In essence, register transfers are essential for managing data within a digital system. They ensure
that valuable information can be used in multiple parts of the system without losing or changing the
original data.

Register Transfer R3 ← R5 Implies:

1. Data Lines: The digital system must have pathways, often referred to as data lines,
connecting the source register (R5) to the destination register (R3). These data lines are like
highways for bits to travel from one register to another.

2. Parallel Load in Destination Register: The destination register (R3) needs a mechanism for
parallel loading. This means that all the bits from the source register (R5) can be loaded into
the destination register at once. It's like pouring a full glass of water into an empty one
without spilling any drops.

3. Control Lines: There must be control lines or signals that initiate and coordinate this transfer
action. These control lines act like traffic signals, ensuring that the data transfer occurs
precisely when it should.

In summary, the register transfer R3 ← R5 tells us that the digital system has data lines connecting
the source and destination registers, a parallel loading mechanism in the destination register, and
control lines to execute this specific transfer action effectively. This orchestrated combination of
hardware elements enables the seamless movement of data within the digital system.
Control Functions in Digital Systems:

• Control functions in digital systems determine whether certain actions should take place
based on a specified condition, much like an "if" statement in programming.

• These control functions are often represented using a control signal, which is a single bit (0
or 1).

• If the control signal is 1, the associated action or operation is executed; if it's 0, the action is
skipped.

Representation:

• Control functions are typically represented using a notation like P: R2 ← R1.

• In this notation, P represents the control signal condition. If P is equal to 1, it means "if (P =
1)," and then the operation, which in this case is "load the contents of register R1 into
register R2," takes place.

In summary, control functions in digital systems allow actions to be conditionally executed based on
the state of a control signal. If the condition (control signal) is met (equal to 1), the specified
operation occurs; otherwise, it is skipped. This enables digital systems to make decisions and
perform actions based on specific criteria.

The representation P: R3 ← R5, MAR ← IR signifies that two operations are intended to occur
simultaneously if the control function P evaluates to 1. Here's a clear explanation:

Simultaneous Operations with Control Function:

• In digital systems, when you see multiple operations separated by commas, such as P: R3 ←
R5, MAR ← IR, it means these operations should occur concurrently, typically triggered by
the same clock signal if the control function P evaluates to 1.
• If P equals 1 (if the condition is met), then two actions take place simultaneously:

1. Load the contents of register R5 into R3. It's like pouring the contents of one glass
into another.

2. Load the contents of register IR into MAR. This is similar to copying the data from
one storage location to another.

This simultaneous execution of operations ensures efficient and coordinated processing within the
digital system. When the control function is true, both actions happen together, typically within the
same clock cycle, ensuring data consistency and synchronization.
A bus in the context of digital systems serves as a pathway, typically consisting of a group of wires,
over which information is transferred between various sources and destinations. Specifically, in
terms of transferring data from a register to the bus, it can be represented as:

From a Register to the Bus:

• BUS ← R: This notation signifies that the contents of a register (in this case, R) are loaded
onto the bus, making the data available for transmission to other destinations or for further
processing.

The bus plays a central role in data movement within digital systems, enabling the efficient sharing
and transfer of information between different components, including registers, memory, and various
processing units.
memory (RAM) can be thought of as a sequential circuit consisting of a set of registers, each holding
words of data. Here's a breakdown of the components and requirements for such a memory:

Memory Organization:

• A RAM can be seen as a collection of registers, each designed to store a word of data.

• Each register has a unique address, and these addresses typically range from 0 to r-1, where
r is the total number of registers (words) in the memory.

• Each register can store n bits of data.

Components and Requirements:

1. Data Input Lines (n): These lines are used to input data into the memory.
They carry n bits of data at a time, allowing you to write information into
the memory.

2. Data Output Lines (n): Similarly, data output lines


carry n bits of data and are used to read data from the
memory.

3. Address Lines (k): The number of address lines


required is determined by the number of registers in the memory. If
the RAM contains r = 2^k words, then you need k address lines to uniquely
select one of these r registers.

4. Read Control Line: This control line is used to initiate the reading of data from the memory.
When activated, it signals the memory to fetch the data stored at the specified address and
place it on the data output lines.

5. Write Control Line: The write control line is used to initiate the writing of data into the
memory. When activated, it instructs the memory to accept and store data from the data
input lines at the specified address.
In summary, a RAM in a digital system is organized as a set of registers, and it requires specific lines
and control signals for data input, data output, address selection, and read/write operations. The
number of address lines k is determined by the size of the memory, which contains r = 2^k words.

Memory in computer systems is viewed and


accessed at the register level using a device often
referred to as "M." To specify which specific location or address in
memory you want to access, you need to use indexing, which involves
referencing a memory address. Here's how it typically works:

Memory Address Register (MAR or AR):

• Memory is usually accessed by placing the desired memory address into a special register
known as the Memory Address Register (MAR) or sometimes simply referred to as the
Address Register (AR).

• The MAR is a dedicated register used to hold the memory address you want to access.

Accessing Memory:

• When you want to access a particular location in memory, you load the desired address into
the MAR.

• The contents of the MAR are then sent to the memory unit's address lines. These address
lines help identify the specific location in memory you want to read from or write to.

In essence, the MAR serves as a bridge between the CPU (Central Processing Unit) or other
processing units and the memory. It allows you to specify which memory location you want to
interact with, and the memory unit uses this address information to fetch or store data from or to
the specified location.

Reading from Memory to a Register (R1):

• To read a value from a memory location and load it into a register (let's say R1), you can
represent it in register transfer language as: R1 ← M[MAR].

• This notation signifies the following sequence of actions:

1. The contents of the Memory Address Register (MAR) are sent to the memory unit's
address lines, indicating the specific memory location you want to read from.

2. A Read signal (typically set to 1) is sent to the memory unit, signaling that you intend
to read from that address.

3. The contents of the specified memory address are placed on the memory's output
data lines.

4. These data lines are then connected to the bus and sent to be loaded into the
designated register, which in this case is R1.

So, R1 ← M[MAR] succinctly represents the process of fetching data from memory, transferring it
over the bus, and loading it into the specified register, R1.
Writing from a Register (R1) to Memory:

• To write a value from a register (e.g., R1) to a specific location in memory, you can represent
it in register transfer language as: M[MAR] ← R1.

• This notation signifies the following sequence of actions:

1. The contents of the Memory Address Register (MAR) are sent to the memory unit's
address lines, indicating the specific memory location where you want to write the
data.

2. A Write signal (typically set to 1) is sent to the memory unit, indicating that you
intend to write data to that address.

3. The values stored in register R1 are sent over the bus to the data input lines of the
memory.

4. These values are loaded into the specified memory address, effectively replacing any
previous data at that location.

So, M[MAR] ← R1 succinctly represents the process of writing data from the register R1 to the
specified memory location, based on the address stored in the Memory Address Register (MAR).

You've provided a set of register transfer language notations, and here's a clear and concise
explanation of each one:

1. A ← B: Transfer the content of register B into register A. This notation copies the data from
B to A.

2. AR ← DR(AD): Transfer the content of the AD (Address) portion of register DR into register
AR. This is often used to specify a memory address.

3. A ← constant: Transfer a binary constant into register A. This sets the value of register A to a
specific constant value.

4. ABUS ← R1, R2 ← ABUS: These two operations occur simultaneously. They transfer the
content of register R1 into bus A (ABUS), and at the same time, they transfer the content of
bus A (ABUS) into register R2.

5. AR: Represents the Address Register, which typically holds a memory address.

6. DR: Represents the Data Register, often used to store data before it's transferred to or from
memory.

7. M[R]: Denotes a memory word specified by the content of register R. This is used for
accessing memory locations.

8. M: Equivalent to M[AR], which means it represents the memory word specified by the
Address Register (AR).

9. DR ← M: Represents a memory read operation, transferring the content of the memory


word specified by the Address Register (AR) into the Data Register (DR).

10. M ← DR: Represents a memory write operation, transferring the content of the Data
Register (DR) into the memory word specified by the Address Register (AR).
Computer system microoperations can be categorized into four main types, each serving specific
purposes:

1. Register Transfer Microoperations:

• Register transfer microoperations involve the transfer of data between registers or


between a register and memory.

• These microoperations include operations like loading data from one register into
another, copying data between registers, and performing various data transfers.

2. Arithmetic Microoperations:

• Arithmetic microoperations are concerned with performing mathematical


operations on data stored in registers.

• Common arithmetic microoperations include addition, subtraction, multiplication,


and division, as well as other arithmetic calculations.


I'll explain the operation R3 ← R1 + R2' + 1 in the context of two's complement representation.

Two's Complement: Two's complement is a binary representation of signed integers that allows
both positive and negative values to be stored and manipulated using binary arithmetic. In two's
complement representation:

• Positive integers have the same binary representation as in unsigned binary (i.e., they start
with a 0 bit).

• Negative integers are represented as the two's complement of their absolute value.

Subtraction Using Two's Complement: The operation R3 ← R1 + R2' + 1 represents


subtraction using two's complement. Let's break it down step by step:
1. Compute the Two's Complement of R2 (R2'):

• To subtract R2 from R1, we first compute the two's complement of R2. This involves
inverting (flipping) all the bits in R2.

• Then, we add 1 to the two's complemented value to account for the subtraction.

2. Add R1 to the Two's Complement of R2:

• We add the contents of R1 to the two's complemented value of R2 (R2' + 1).

• This addition essentially performs subtraction in the two's complement form, which
is a convenient way to subtract numbers in binary.

3. Transfer the Result to R3:

• The result of the addition (subtraction) operation is transferred to register R3.

The key concept here is that in two's complement representation, adding a negative
number (represented as the two's complement) is equivalent to subtraction. By
performing this addition and then transferring the result to R3, we effectively
compute the subtraction of R2 from R1.

This approach allows for efficient and consistent handling of both addition and
subtraction using binary arithmetic in digital systems, making it possible to perform
various mathematical operations, including signed arithmetic, with a common set of
hardware components.
3. Logic Microoperations:

• Logic microoperations involve logical operations on data, often used for data
manipulation and decision-making.

• These microoperations include operations like AND, OR, NOT, XOR, and various bit-
level manipulations.
Operation Description

A is modified by selectively setting specific bits to 1 based on


the corresponding bits in B. This operation effectively turns
on (sets to 1) the bits in A where the corresponding bits in B
Selective-Set are also 1.

A is modified by selectively toggling (complementing) specific


Selective- bits based on the corresponding bits in B. If a bit in B is 1, the
Complement corresponding bit in A is toggled (flipped).

A is modified by selectively clearing specific bits to 0 based on


the corresponding bits in B. This operation effectively turns
Selective- off (clears to 0) the bits in A where the corresponding bits in B
Clear are 1.

A is modified by using B as a mask. Only the bits in A


Mask corresponding to 1s in B are retained, and the rest are cleared
(Delete) to 0.

Clear A is modified by clearing (setting to 0) the bits where B has 1s.

A is modified by inserting a new value C into it. This operation


combines A and C based on the bits in B, where 1s in B select
Insert bits from C to insert into A.

A is modified by performing a bitwise comparison with B.


Each bit in A is compared to the corresponding bit in B, and
the result is stored in A. This is often used to check for
Compare equality between two bit patterns.
4. Shift Microoperations:

• Shift microoperations involve shifting the bits of data within a register to the left or
right.

• They are commonly used for tasks like data reordering, multiplication or division by
powers of 2, and other bit-level operations.

In digital systems, a logical shift operation involves shifting the bits of a binary number either to the
left (logical shift left - shl) or to the right (logical shift right - shr) while introducing a 0 as the serial
input to the shift. Here's an explanation of each type of logical shift:
Logical Shift Left (shl):

• In a logical shift left operation, the bits of a binary number are shifted to the left.

• Each bit is moved to the left by one position, and a 0 is introduced as the new bit at the
rightmost position.

• This effectively multiplies the number by 2 for each shift left operation.

Example (Register Transfer Language - RTL):

R2 ← shl R2

• This RTL notation represents that the contents of register R2 are shifted left by one bit
position.

Logical Shift Right (shr):

• In a logical shift right operation, the bits of a binary number are shifted to the right.

• Each bit is moved to the right by one position, and a 0 is introduced as the new bit at the
leftmost position.

• This effectively divides the number by 2 for each shift right operation.

Example (Register Transfer Language - RTL):

R3 ← shr R3

• This RTL notation represents that the contents of register R3 are shifted right by one bit
position.

Logical shifts are commonly used in digital systems for various purposes, such as data manipulation,
division and multiplication by powers of 2, and bit extraction. They are fundamental operations in
digital circuitry and microprocessor architectures.

In digital systems, a circular shift operation involves shifting the bits of a binary number either to the
left (circular shift left - cil) or to the right (circular shift right - cir) while introducing the bit that is
shifted out of one end as the serial input to the other end. Here's an explanation of each type of
circular shift:

Circular Shift Left (cil):

• In a circular shift left operation, the bits of a binary number are shifted to the left.
• Each bit is moved to the left by one position, and the bit that is shifted out from the leftmost
end is introduced as the new bit at the rightmost end.

• This operation effectively rotates the bits within the register, and no bits are lost.

Example (Register Transfer Language - RTL):

R2 ← cil R2

• This RTL notation represents that the contents of register R2 are circularly shifted left by one
bit position.

Circular Shift Right (cir):

• In a circular shift right operation, the bits of a binary number are shifted to the right.

• Each bit is moved to the right by one position, and the bit that is shifted out from the
rightmost end is introduced as the new bit at the leftmost end.

• Similar to a left circular shift, this operation effectively rotates the bits within the register,
and no bits are lost.

Example (Register Transfer Language - RTL):

R3 ← cir R3

• This RTL notation represents that the contents of register R3 are circularly shifted right by
one bit position.

Circular shifts are used in digital systems when you want to rotate the bits within a register while
preserving all bits in the process. They are often used in cryptographic algorithms, data encryption,
and when implementing circular buffers or data structures.

1. Logical Shift:

• In a logical shift operation, the newly created bit position (either on the left or right,
depending on the shift direction) is filled with a zero.


• This means that regardless of whether it's a logical shift left (shl) or logical shift right
(shr), a zero is introduced into the newly vacated bit position.
2. Arithmetic Shift:

• In an arithmetic shift operation, the newly created bit position (again, left or right,
depending on the shift direction) is filled with a copy of the number's sign bit.

• If the number is positive (the sign bit is 0), the newly introduced bit is 0. If the
number is negative (the sign bit is 1), the newly introduced bit is 1.


• This behavior helps preserve the sign of the number when shifting, making
arithmetic shifts suitable for signed integers.
Arithmetic shifts are commonly used in signed integer operations to maintain the correct sign bit
and to perform division or multiplication by powers of 2 while preserving the sign. Logical shifts, on
the other hand, are often used for simple data manipulation and bit extraction, where the sign is not
a consideration.
These microoperations are essential building blocks of digital systems and play a critical role in
processing data and control within a computer system. They enable the manipulation,
transformation, and storage of information necessary for various computational tasks.

1. Instruction Code:

• An instruction code is a group of bits that instructs the computer to perform a


specific operation.

• It serves as the command to the computer's central processing unit (CPU) to execute
a particular action or task.

• Each instruction code corresponds to a specific operation, such as arithmetic


calculations (addition, subtraction), data manipulation (shift, complement), or
control flow (branching, jumping).

2. Operation Code (OpCode):

• The operation code (OpCode) is a subset of the instruction code.

• It is a group of bits within the instruction that specifically defines the operation to be
performed.

• For example, in an assembly language or machine language instruction, the OpCode


might specify whether the instruction is an addition, subtraction, multiplication, or
any other operation.

• The CPU uses the OpCode to determine the type of operation it needs to execute.

3. Operands:

• An instruction typically includes one or more operands.

• Operands are components of the instruction that indicate the source(s) and
destination(s) of data for the operation.

• Operands can represent registers, memory addresses, or immediate values.

• Registers are internal storage locations within the CPU, while memory addresses
refer to locations in the computer's main memory (RAM).

• Operands tell the CPU where to fetch data from and where to store the result after
the operation is performed.

In summary, an instruction code consists of OpCode and operands. The OpCode specifies the
operation to be performed, while operands indicate the data sources and destinations for that
operation. This structure allows the CPU to execute a wide range of tasks based on the instruction
codes it receives, making it a fundamental concept in computer architecture and programming.

1. Storage of Instructions:
• Instructions in a computer are stored in memory, typically in the same way that data
is stored.

• Computer memory is organized into addressable locations, and each instruction is


stored at a specific memory address.

• The instructions are represented in binary form, with each instruction having its
unique bit pattern.

2. Interpretation by the Control Unit:

• The control unit, a fundamental component of the CPU (Central Processing Unit),
plays a vital role in interpreting and executing instructions.

• When the CPU fetches an instruction from memory, the control unit decodes it to
understand the intended operation.

• The operation code (opcode) within the instruction is used by the control unit to
determine the type of operation to be performed.

3. Sequences of Microoperations:

• Once the opcode is identified, the control unit uses it to determine the sequences of
microoperations that must be executed to carry out the instruction's intended task.

• Microoperations are elementary operations that involve activities such as data


movement, arithmetic calculations, logic operations, and control flow decisions.

4. Execution of the Instruction:

• The control unit coordinates the execution of the instruction by generating control
signals.

• These control signals activate specific components of the CPU, including registers,
ALUs (Arithmetic Logic Units), and data buses, to perform the microoperations
required by the instruction.

• Data may be fetched from registers or memory, manipulated, and then stored back
in registers or memory as necessary to complete the instruction.

In essence, the control unit's role is pivotal in executing instructions. It translates the instructions,
extracts the operation code, and orchestrates the sequence of microoperations needed to carry out
the instruction, ensuring that the computer performs the desired tasks as specified by the program.

1. Stored Program Organisation:

Operand Specification:

• In computer instructions, operands are specified by indicating the registers and/or


memory locations where the data to be operated upon is stored.

• To specify which registers or memory locations are to be used, a certain number of


bits, denoted as "k" bits, are typically allocated for this purpose.

• These k bits allow the instruction to identify one of 2^k possible registers or memory
locations.
2. The Accumulator Design:

• One common design approach is to include a special processor register known as the
"accumulator."

• Instructions are structured with two main fields:

• Opcode Field: This field contains the operation code (opcode) that specifies
the type of operation to be performed.

• Operand Field: This field, often referred to as the "operand," contains


information about the operand(s) involved in the operation.

• The operand field can be further divided to specify either a register or a memory
location.

3. Flexible Use of Operand Bits:

• One advantage of this design is that instructions that do not require a memory
operand can make use of the operand bits for other purposes.

• For example, these bits can be used to specify different operations or to provide
additional control information.

• This flexibility allows for a compact instruction format while accommodating a


variety of operations and addressing modes.


In summary, operand specification in computer instructions involves allocating bits to identify
registers and memory locations. The use of an accumulator and flexible operand field design allows
for efficient and versatile instruction formats that can represent a wide range of operations and
addressing modes within a computer's architecture.

Let's briefly explain each of these operand types:

1. Direct Operand:

• A direct operand refers to an operand whose data is stored directly in the specified
register or memory location.

• In other words, the instruction uses the content of the specified register or memory
location as the operand for the operation.
• For example, if you have an instruction like "ADD R1, R2," R1 and R2 are direct
operands, and the operation involves adding the contents of R2 to R1.

2. Indirect Operand:

• An indirect operand is an operand whose address or pointer is stored in the


specified register or memory location.

• Instead of directly containing the data, this operand contains a reference (address)
to the location where the data can be found.

• To access the actual data, the instruction must first follow the reference to the
correct location.

• Indirect addressing is often used for operations involving data at dynamically


determined memory locations.

3. Immediate Operand:

• An immediate operand is an operand whose value is directly specified within the


instruction itself.

• It does not reference a register or memory location but provides a constant value
that is used as an operand for the operation.

• Immediate operands are useful for instructions that involve constants or values that
are known at compile time.

4. Register Operand:

• A register operand refers to an operand that specifies a processor register as the


source or destination for the data.

• Instead of referencing memory locations, the instruction operates on data stored


within registers.

• Register operands are often used for fast and efficient data manipulation since
register access is typically faster than memory access.
These different types of operands allow instructions to be versatile and adaptable to various
computational tasks and data storage requirements in computer programs. The choice of operand
type depends on the specific needs of the instruction and the architecture of the computer system.

1. Program Counter (PC):

• The Program Counter is a special register that stores the memory address of the
next instruction to be executed.

• It ensures that instructions are fetched and executed sequentially, one after the
other.

• After each instruction is executed, the PC is typically incremented to point to the


next instruction in memory.

2. Memory Address Registers (MAR) and Memory Buffer Registers (MBR):

• The Memory Address Register (MAR) is a register used to store the memory address
from which data or an instruction needs to be read or to which data needs to be
written.

• The Memory Buffer Register (MBR) is a register used to temporarily hold the data or
instruction being read from or written to memory.

• Together, MAR and MBR facilitate the transfer of data between the CPU and
memory.

3. Temporary Data Registers:

• Temporary Data Registers, often referred to as general-purpose registers or working


registers, are used to store data temporarily during computational tasks.

• These registers are not tied to specific functions and are available for various data
manipulation operations.

• They play a crucial role in executing arithmetic, logical, and data transfer operations.

4. Instruction Register (IR):

• The Instruction Register (IR) is a special register that holds the current instruction
being executed by the CPU.

• During the execution of an instruction, the IR stores the opcode and operand
information, facilitating the decoding and execution of the instruction.

5. Input and Output Registers:

• Input and Output Registers are used for temporary storage of data during input and
output operations.

• When data is read from an input device (e.g., keyboard), it is temporarily stored in
an input register before being processed.
• Similarly, data to be written to an output device (e.g., display) is temporarily held in
an output register before being sent out.

These registers and components work together to enable the fetch-decode-execute cycle of
computer instructions. The program counter ensures sequential execution, memory address and
data registers facilitate memory access, temporary data registers hold intermediate values, the
instruction register manages the currently executing instruction, and input/output registers aid in
data transfer between the CPU and external devices.

1. Common Bus:

• To reduce the complexity of wiring, memory, and registers are connected through a
common bus.

• The common bus serves as a communication pathway for data transfer between
various components of the computer, including registers and memory.
2. Bus Selection (S2S1S0):

• The specific output selected on the common bus is determined by a set of control
lines denoted as S2, S1, and S0.

• These control lines determine which register's data or which memory location's data
is placed on the bus.

3. Load (LD), Increment (INR), and Clear (CLR) Controls:

• Registers can be loaded with data from the bus when their respective load (LD)
control input is enabled.

• Registers can also be incremented by setting the INR control input or cleared by
setting the CLR control input.

• These control signals allow for data manipulation and transfer within the registers.

4. Accumulator and Data Register:

• The Accumulator's input is directed through an Adder & Logic Circuit.

• This arrangement enables the simultaneous exchange of data between the


Accumulator and Data Register.

• Such data swaps are essential for various arithmetic and logical operations.

5. Address Register:

• When accessing a specific memory location, the address of that location must be
loaded into the Address Register.

• The Address Register specifies which memory location will be read from or written
to during memory operations.

These principles are fundamental to the organization and operation of a computer's central
processing unit (CPU) and memory subsystem. They allow for efficient data movement,
manipulation, and control during program execution, contributing to the functionality and versatility
of digital computers.
clear description of the three instruction code formats used in a basic computer architecture. Let's
summarize and elaborate on each of these formats:

1. Memory-Reference Format:

• This format is used for instructions that involve memory operations.

• It consists of:

• Seven 3-bit opcodes: These opcodes specify the type of memory operation
to be performed (e.g., load, store, compare).

• A 12-bit memory address: This field contains the memory address where the
operation will take place.

• A bit indicating addressing mode: This bit distinguishes between direct and
indirect addressing, allowing for flexibility in memory access.

2. Register-Reference Format:

• This format is used for instructions that involve register operations.

• It consists of:

• The bit sequence "0111": This serves as an opcode indicating a register


instruction.

• 12 bits indicating the specific register or registers involved in the operation.

• In this format, one or more of the lower 12 bits are set to identify the source and
destination registers, specifying the operation to be carried out.

3. Input-Output Format:
• This format is used for input and output (I/O) instructions.

• It consists of:

• The bit sequence "1111": This serves as an opcode indicating an I/O


instruction.

• 12 bits that specify the particular I/O operation to be performed.

• Similar to the register-reference format, only one of the lower 12 bits is typically set
to identify the specific I/O operation.

These instruction code formats provide a structured and standardized way to represent different
types of instructions in a computer's architecture. Memory-reference format deals with memory
access, register-reference format with register operations, and input-output format with I/O
operations. The use of distinct opcodes and address fields allows the CPU to interpret and execute
instructions accurately based on their formats and content.

In computer architecture, an instruction set is considered complete when it encompasses a sufficient


number of instructions in each of the following categories:

1. Arithmetic, Logical, and Shift Instructions:

• These instructions are essential for performing mathematical calculations, logical


operations, and data manipulation within the CPU.

• Arithmetic instructions include addition, subtraction, multiplication, and division.

• Logical instructions perform operations like AND, OR, XOR, and NOT.

• Shift instructions are used for bit-level operations such as shifting left or right.

2. Data Transfer Instructions:

• These instructions facilitate the movement of data between registers and memory,
as well as between different registers.

• They include load (move data from memory to register), store (move data from
register to memory), and register-to-register transfer instructions.

3. Program Control and Status-Checking Instructions:

• These instructions are responsible for controlling the flow of program execution and
managing the status of the CPU.

• They include branching instructions (e.g., conditional and unconditional jumps),


subroutine call and return instructions, and instructions for managing program
counters.

• Status-checking instructions enable the CPU to check and set various flags or
condition codes that influence program flow.

4. Input and Output Instructions:

• Input and output instructions are vital for communication between the computer
and external devices.
• Input instructions allow data to be read from input devices (e.g., keyboards or
sensors) into the computer.

• Output instructions enable data to be sent from the computer to output devices
(e.g., displays or printers).

A complete instruction set ensures that the computer can perform a wide range of tasks and
operations, making it versatile and capable of executing a variety of programs. It allows
programmers to write efficient and comprehensive software for different applications while taking
advantage of the full capabilities of the hardware.

1.
Data Moves (LDA and STA):

• The LDA (Load Accumulator) and STA (Store Accumulator) instructions provide the
capability to move data between memory and the accumulator (a CPU register).

• LDA loads data from memory into the accumulator, while STA stores the
accumulator's content back into memory.

• These instructions are fundamental for data transfer between memory and the CPU.

2. Control Flow Instructions:

• Control flow instructions are crucial for managing program execution. You've
mentioned several types:

• Unconditional Branch (BUN): This instruction allows for unconditional


branching or jumping to a different location in the program.

• Subprogram Calls (BSA): Subprogram calls are used for invoking subroutines
or functions within a program, enabling modular and structured
programming.
• Conditional Branch (ISZ): Conditional branching allows the program to make
decisions based on a condition, typically involving the incrementation of a
value and checking for zero.

3. Input and Output Instructions:

• Input and output instructions are essential for communication between the
computer and external devices. These instructions facilitate the transfer of data to
and from devices such as keyboards, displays, printers, and more.

• Handling interrupts generated by input and output operations is crucial for


managing asynchronous events and maintaining system responsiveness.

Overall, the combination of data movement, control flow, input/output, and interrupt handling
instructions forms a comprehensive set of capabilities necessary for a computer to execute a wide
range of programs and interact with its environment effectively. These instructions are fundamental
building blocks for software development and system operation.

Timing and Control


Master Clock Generator:

• The entire system's timing is synchronized by a master clock generator.

• It generates regular clock pulses that serve as the fundamental timing reference for
the entire computer system.

• Clock Pulses for Registers and Flip-Flops:

• The clock pulses from the master clock generator are applied to all registers and flip-
flops in the system, including those within the control unit.

• Flip-flops and registers rely on these clock pulses for proper data storage and
processing.

• Control Signals from the Control Unit:

• The control unit is responsible for generating control signals.

• These control signals:

• Control the multiplexers on the data bus.

• Provide control inputs for processor registers.

• Define microoperations for the accumulator.

1. Precise timing and control mechanisms, facilitated by the master clock generator and control
unit, are crucial for the coordinated and synchronized operation of a digital computer. They
ensure data is processed accurately and efficiently, contributing to the overall reliability and
functionality of the system.

1) Hardwired Control:

• In hardwired control, control logic is implemented using digital circuits such as gates,
flip-flops, decoders, multiplexers, and other combinational and sequential logic
components.

• The control signals are generated directly by the wired connections between these
components based on the instruction being executed.

• Hardwired control is typically faster and more efficient for simple instruction sets or
architectures with fixed and straightforward control sequences.

2. Microprogrammed Control:

• Microprogrammed control, also known as microcode control, involves storing


control information in a control memory or control store.

• The control memory contains microinstructions, which are small programs that
specify the sequence of microoperations to execute for each instruction.

• A control unit fetches microinstruction from the control memory and interprets
them to generate the necessary control signals.
• Microprogrammed control offers flexibility and ease of modification because
changes to the control behavior can be made by updating the microcode in the
control memory.

The choice between hardwired and microprogrammed control depends on various factors, including
the complexity of the instruction set, the desired level of flexibility, ease of modification, and the
specific requirements of the computer architecture. Both approaches have their advantages and
trade-offs, and designers select the most suitable one based on the intended use and design goals.

• Timing Signal Generation:

• Timing signals are essential for controlling the sequence of operations in a digital
system.

• These signals dictate when specific actions or microoperations should occur during
the execution of instructions.

• Sequence Counter (SC):

• The sequence counter is a


critical component
responsible for generating
timing signals.

• It receives inputs such as


clock pulses, increment
signals, and clear signals.

• Decoded Timing Signals:

• The outputs of the sequence


counter (SC) are decoded into
16 distinct timing signals,
labeled T0 through T15.

• These signals are used to precisely


control the timing of various
operations within the computer
system.

• RTL Statement Example:

• An example RTL (Register Transfer


Language) statement, "D7T15: SC 0,"
is provided.

• This statement resets the sequence


counter to zero, effectively
indicating the start of a new
sequence of operations.

• The next timing signal to be generated after this reset is T0.


In summary, timing signals and the sequence counter play a crucial role in coordinating the precise
timing of operations within a digital system. The sequence counter generates a series of timing
signals, and their proper control ensures that instructions and microoperations are executed in the
correct sequence and at the right time.

Key phases within the instruction cycle, which is a fundamental concept in computer architecture
and the execution of programs. Here's a breakdown of each phase:

1. Fetch an Instruction from Memory:

• In this phase, the computer retrieves the next instruction to be executed from its
memory (often referred to as the instruction memory or program memory).

• The instruction is fetched based on the current program counter (PC) value, which
points to the address of the next instruction in memory.

2. Decode the Instruction:

• After fetching the instruction, the computer's control unit decodes it.

• Decoding involves determining the operation specified by the instruction, the


operands involved, and any addressing modes or additional information needed for
execution.

3. Read the Effective Address (if needed):

• Some instructions may require the computation of an effective memory address,


especially if the instruction uses indirect addressing.

• In this phase, the CPU may calculate the effective address or retrieve it from
memory.

4. Execute the Instruction:

• The execution phase is where the actual operation specified by the instruction is
carried out.

• This can involve various actions such as arithmetic calculations, data transfers
between registers and memory, logical operations, branching, and more, depending
on the instruction's purpose.

These phases together constitute the instruction cycle, which is repeated for each instruction in a
program. It ensures that instructions are fetched, decoded, and executed in a systematic and
controlled manner, enabling the computer to perform the desired tasks as outlined in the program's
instructions.
Hardwired Control Unit Microprogrammed Control Unit

Hardwired control unit generates the control Microprogrammed control unit generates
signals needed for the processor using logic the control signals with the help of micro
circuits instructions stored in control memory

Hardwired control unit is faster when compared to


This is slower than the other as micro
microprogrammed control unit as the required
instructions are used for generating signals
control signals are generated with the help of
here
hardwares
Hardwired Control Unit Microprogrammed Control Unit

Difficult to modify as the control signals that need Easy to modify as the modification need to
to be generated are hard wired be done only at the instruction level

Less costlier than hardwired control as


More costlier as everything has to be realized in
only micro instructions are used for
terms of logic gates
generating control signals

It cannot handle complex instructions as the


It can handle complex instructions
circuit design for it becomes complex

Only limited number of instructions are used due Control signals for many instructions can
to the hardware implementation be generated

Used in computer that makes use of Reduced Used in computer that makes use of
Instruction Set Computers(RISC) Complex Instruction Set Computers(CISC)

You might also like