Professional Documents
Culture Documents
Language of Computer
Language of Computer
Language Of Computer
INSTRUCTION REPRESENTATION
R format
I format
J format
This chapter we will learn about:
instruction in encoding
MIPS instruction format for (Add instruction, Immediate instruction, Data Transfer
instruction)
FORMAT INSTRUCTION
ADDRESSED
All instruction and data are stored in memory, everything has a memory
address
Pointer are just a memory address, they can point anything in memory.
One register keeps address of instruction that had been executed.
Why program in binary form?
- to suited a different version for computer (Operating System)
Words in Machine language is a set of bits data (32-bits block)
Currently all data we work is in word:
- each register is a word
- Lw and sw both access memory one word at a time
INSTRUCTION AS NUMBER
One word is 32 bits, so divide instruction into fields
Each field tells processor something about instruction
- We could define different field for each instruction, but MIPS is based on
simplicity, so define 3 basic types of instruction formats:
I format = used for instruction with immediate lw and sw
- arithmetic/logical
- shift
- jump register
R type instruction
6 bits
5 bits
op
rs
5 bits
5 bits
5 bits
6 bits
rt
rd
shamt
funct
00111
00101
00000
100000
000000
0110
I type instruction
6 bits
op
001000
5 bits
rs
00010
5 bits
rt
16 bits
immediate
00001
J type instruction
6 bits
26 bits
op
address
0000 10
j loop