Fluxograma do funcionamento do Computador IAS - Instruções de Endereço
flowchart TB
subgraph _fetch_cycle_ [Fetch Cycle]
START((Start)):::greenClass --> B{"Is next instruction in IBR?"}
B --> |"Yes No memory access required"| F("IR ← IBR(0:7)
MAR ← IBR(8:19)")
F --> I
B --> |No| C("MAR ← PC")
C --> D("MBR ← M(MAR)")
D --> E{"Left instruction required?"}
E --> |No| H("IR ← MBR(20:27)
MAR ← MBR(28:39)")
E --> |Yes| G("IBR ← MBR(20:39)
IR ← MBR(0:7)
MAR ← MBR(8:19)")
H --> I("PC ← PC + 1 IBR ← 0")
end
subgraph _decode_ [ ]
I --> DECODE
G --> DECODE
DECODE{{"Decode instruction in IR"}}:::orangeClass
style _decode_ fill:transparent,stroke:transparent
direction TB
end
subgraph _execution_cycle_ [Execution Cycle]
DECODE --> |"STOR M(X, 8:19) Opcode: 00010010"| STOR_MXL
subgraph STOR_MXL ["STOR M(X, 8:19)"]
STOR_MXL1("MBR ← M(MAR)"):::clickable
STOR_MXL2("MBR(8:19) ← AC(28:39)"):::clickable
STOR_MXL3("M(MAR) ← MBR"):::clickable
STOR_MXL1 --> STOR_MXL2 --> STOR_MXL3
direction TB
end
DECODE --> |"STOR M(X, 28:39) Opcode: 00010011"| STOR_MXR
subgraph STOR_MXR ["STOR M(X, 28:39)"]
STOR_MXR1("MBR ← M(MAR)"):::clickable
STOR_MXR2("MBR(28:39) ← AC(28:39)"):::clickable
STOR_MXR3("M(MAR) ← MBR"):::clickable
STOR_MXR1 --> STOR_MXR2 --> STOR_MXR3
direction TB
end
DECODE --> |"JUMP M(X, 0:19) Opcode: 00001101"| JUMP_ML
subgraph JUMP_ML ["JUMP M(X, 0:19)"]
JUMP_MXL1("PC ← MAR IBR ← 0"):::clickable
JUMP_MXL2("Left instruction required: YES"):::clickable
JUMP_MXL1 --> JUMP_MXL2
direction TB
end
DECODE --> |"JUMP M(X, 20:39) Opcode: 00001110"| JUMP_MR
subgraph JUMP_MR ["JUMP M(X, 20:39)"]
JUMP_MXR1("PC ← MAR IBR ← 0"):::clickable
JUMP_MXR2("Left instruction required: NO"):::clickable
JUMP_MXR1 --> JUMP_MXR2
direction TB
end
DECODE --> |"JUMP+ M(X, 0:19) Opcode: 00001111"| JUMP+_ML
subgraph JUMP+_ML ["JUMP+ M(X, 0:19)"]
JUMP1_MXL1{"AC >= 0"}:::clickable
JUMP1_MXL2("PC ← MAR IBR ← 0"):::clickable
JUMP1_MXL3("Left instruction required: YES"):::clickable
DO_NOTHING_L("Do nothing"):::clickable
JUMP1_MXL1 --> |Yes| JUMP1_MXL2 --> JUMP1_MXL3
JUMP1_MXL1 --> |No| DO_NOTHING_L
direction TB
end
DECODE --> |"JUMP+ M(X, 20:39) Opcode: 00010000"| JUMP+_MR
subgraph JUMP+_MR ["JUMP+ M(X, 20:39)"]
JUMP1_MXR1{"AC >= 0"}:::clickable
JUMP1_MXR2("PC ← MAR IBR ← 0"):::clickable
JUMP1_MXR3("Left instruction required: NO"):::clickable
DO_NOTHING_R("Do nothing"):::clickable
JUMP1_MXR1 --> |Yes| JUMP1_MXR2 --> JUMP1_MXR3
JUMP1_MXR1 --> |No| DO_NOTHING_R
direction TB
end
end
subgraph _end_ [End]
style _end_ fill:transparent,stroke:transparent
END(("Go back to Start")):::greenClass
STOR_MXL --- END
STOR_MXR --- END
JUMP_ML --- END
JUMP_MR --- END
JUMP+_ML --- END
JUMP+_MR --- END
direction TB
end
classDef greenClass fill:#008000
classDef orangeClass fill:#FF6347
classDef redFontClass color:#FF0000
classDef clickable cursor:pointer,stroke:#3366ff,stroke-width:2px