0% found this document useful (0 votes)
34 views

Memory Operations: Read Operation: Memory Retrieves Contents at

The document discusses computer memory operations, register transfer notation, and assembly language notation. It introduces RISC and CISC instruction sets, focusing on RISC. RISC uses load and store instructions to access memory operands and requires that operands for arithmetic instructions be in registers. An example program in RISC assembly language that loads data from memory locations, performs an addition, and stores the result is presented.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Memory Operations: Read Operation: Memory Retrieves Contents at

The document discusses computer memory operations, register transfer notation, and assembly language notation. It introduces RISC and CISC instruction sets, focusing on RISC. RISC uses load and store instructions to access memory operands and requires that operands for arithmetic instructions be in registers. An example program in RISC assembly language that loads data from memory locations, performs an addition, and stores the result is presented.

Uploaded by

Raj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

25/01/2016

Memory Operations
• Memory contains data & program instructions
• Control circuits initiate transfer of data and
instructions between memory and processor
• Read operation: memory retrieves contents at
address location given by processor
• Write operation: memory overwrites contents
at given location with given data

Instructions and Sequencing


• Instructions for a computer must support:
– data transfers to and from the memory
– arithmetic and logic operations on data
– program sequencing and control
– input/output transfers
• First consider data transfer & arithmetic/logic
• Control and input/output examined later
• Introduce notation to facilitate discussion

1
25/01/2016

Register Transfer Notation


• Register transfer notation is used to describe
hardware-level data transfers and operations
• Predefined names for processor registers and
I/O registers
• Arbitrary names for locations in memory
• Use […] to denote contents of a location
• Use ← to denote transfer to a destination
• Example: R2 ← [LOC]
(transfer from LOC in memory to register R2)

Register Transfer Notation


• RTN can be extended to also show
arithmetic operations involving locations
• Example: R4 ← [R2] + [R3]
(add the contents of registers R2 and R3,
place the sum in register R4)
• Right-hand expression always denotes a value,
left-hand side always names a location

2
25/01/2016

Assembly-Language Notation
• RTN shows data transfers and arithmetic
• Another notation needed to represent
machine instructions & programs using them
• Assembly language is used for this purpose
• For the two preceding examples using RTN,
the assembly-language instructions are:
Load R2, LOC
Add R4, R2, R3

Assembly-Language Notation
• An instruction specifies the desired operation
and the operands that are involved
• Examples here will use English words for the
operations (e.g., Load, Store, and Add)
• This helps emphasize fundamental concepts
• Commercial processors use mnemonics,
usually abbreviations (e.g., LD, ST, and ADD)
• Mnemonics differ from processor to processor

3
25/01/2016

RISC and CISC Instruction Sets


• Nature of instructions distinguishes computer
• Two fundamentally different approaches
• Reduced Instruction Set Computers (RISC)
have one-word instructions and
require arithmetic operands to be in registers
• Complex Instruction Set Computers (CISC)
have multi-word instructions and
allow operands directly from memory

RISC Instruction Sets


• Focus on RISC first because it is simpler
• RISC instructions each occupy a single word
• A load/store architecture is used, meaning:
– only Load and Store instructions are used
to access memory operands
– operands for arithmetic/logic instructions
must be in registers, or one of them
may be given explicitly in instruction word

4
25/01/2016

RISC Instruction Sets


• Instructions/data are stored in the memory
• Processor register contents are initially invalid
• Because RISC requires register operands,
data transfers are required before arithmetic
• The Load instruction is used for this purpose:
Load procr_register, mem_location
• Addressing mode specifies memory location;
different modes are discussed later

RISC Instruction Sets


• Consider high-level language statement:
C=A+B
• A, B, and C correspond to memory locations
• RTN specification with these symbolic names:
C ← [A] + [B]
• Steps: fetch contents of locations A and B,
compute sum, and transfer result to location C

5
25/01/2016

RISC Instruction Sets


• Sequence of simple RISC instructions for task:
Load R2, A
Load R3, B
Add R4, R2, R3
Store R4, C
• Load instruction transfers data to register
• Store instruction transfers data to the memory
• Destination differs with same operand order

A Program in the Memory


• Consider the preceding 4-instruction program
• How is it stored in the memory?
(32-bit word length, byte-addressable)
• Place first RISC instruction word at address i
• Remaining instructions are at i + 4, i + 8, i + 12
• For now, assume that Load/Store instructions
specify desired operand address directly;
this issue is discussed in detail later

6
25/01/2016

You might also like