Expanding Codes
Expanding Codes
Instruction formats
• Expanding Opcodes
Instruction types
Addressing
2
Instruction formats
Expanding Opcodes
3
Instruction formats
Expanding Opcodes
4
Instruction formats
Expanding Opcodes
5
Instruction formats
Expanding Opcodes
6
Instruction formats
Expanding Opcodes
7
Instruction formats
Expanding Opcodes
8
Instruction formats
Expanding Opcodes
9
Instruction formats
Expanding Opcodes
10
Instruction formats
Expanding Opcodes
Solution:
• The first 4 instructions account for:
- 4x23x23x23 = 4 x 29 = 2048 bit patterns
• The next 255 instructions account for:
- 255 x 23= 2040 bit patterns
• The last 16 instructions account for 16 bit patterns
• In total we need 2048 + 2040 + 16 = 4104 bit patterns
• With 12 bit instruction we can only have 212 = 4096
bit patterns
• Required bit patterns (4104) is more than what we
have (4096), so this instruction set is not possible
with only 12 bits.
11
Instruction formats
Expanding Opcodes
12
Instruction formats
Expanding Opcodes
Solution:
• The first 7 instructions account for:
- 7 x 215 x 215 x 23 =7 x 233 = 60,129,542,144 bit patterns
• The next 500 instructions account for:
- 500 x 215 x 23 = 131,072,000 bit patterns
• The next 50 instructions account for:
- 50 bit patterns
• In total we need 6.026 x 1010 bit patterns
• With 36 bit instructions we can have 236 = 6.87 x 1010
bit patterns
• We have enough bit patterns so can create opcodes
13
Instruction formats
Expanding Opcodes
14
Lecture Overview
Instruction formats
Expanding Opcodes
Instruction types
Addressing
15
Instruction types
Instruction types
16
Instruction types
Instruction types
17
Instruction types
Instruction types
18
Instruction types
Instruction types
19
Lecture Overview
Instruction formats
Expanding Opcodes
Addressing
• Introduction
• Addressing Modes
20
Addressing
Addressing - Introduction
21
Addressing
Addressing Modes
Immediate addressing
• The data is part of the instruction.
• Example: Load 008
- The numeric value 8 is loaded into the AC
Direct addressing
• The address of the data is given in the instruction.
• Example: Load 008
- The data value found at memory address 008 is loaded into the
AC
Register addressing
• The data is located in a register.
• Example: Load R1.
- The contents of R1 register is used as the operand.
22
Addressing
Addressing Modes
Indirect addressing
• Gives the address of the address of the data in
the instruction.
• Example Load 008
- The data value found at memory address 008 is
actually the effective address of the desired operand.
→Suppose we find the value 2A0 stored in location 008.
→2A0 is the “real” address of the value we want.
→The value found at location 2A0 is then loaded into the AC
23
Addressing
Addressing Modes
24
Addressing
Addressing Modes
25
Addressing
Addressing Modes
26
Addressing
Addressing Modes
800
27
Addressing
Addressing Modes
800
900
28
Addressing
Addressing Modes
800
900
1000
29
Addressing
Addressing Modes
800
900
1000
700
30