Tech InfoThis book will describe the computer in great detail. For now, it contains the most recent versions of circuits and ideas.
Conditional Status and Flags Register
The Conditional Status describes the result of a data operation. This can be (not exclusive):
Zero (Z): if the result is zero
Negative (N): if the result is negative
Carry (C): Arithmetic carry
Overflow (V): if the result does not fit into the destination
The S-BUS
Since the Conditional Status refers to a result and this is always kept in some register, detecting status is a job for the register's circuitry. Therefore, each register offers its own means for detecting its own Conditional Status.
The way for registers to deliver their individual status to the Flags register, is by the mean of a 4-bits bus (wired in the Data Slots) called S-BUS.
All registers are constantly generating status signals internally but, at a given time, only one is open to the S-BUS. This is because Flags should only be set according to the register being accessed by the current instruction and only if that instruction is meant to affect flags.
An exception to this rule are those instructions that increment or decrement two registers at the same time (INCM, DECM and INDEC). In this case both registers open to the S-BUS and flags are set as an "OR" of the individual conditions.
There are none dedicated control signals for opening registers to the S-BUS. The selection is made automatically when the register in question is Loaded, Incremented or Decremented.
Registers that do not report status
Registers that are not meant to hold results, won't report conditional status (they are not wired to do so). Those are the following:
-- Program Counter (PC)
-- Stack Pointer (SP)
-- Operand Register (OR)
-- Instruction Register (IR)
The Flags Register (F)
The Flags register (F) resides in the Master Controller card (MC) which plugs to both Data and Control slots. The register is 8-bits but only 4 are used to remember the Conditional Status; a 5th. bit is used to remember the Interrupt Enabled condition as we shall see; the remaining 3 bits are implemented but not used (reserved for future use). The whole register F is saved to the Stack during CALL or Interrupt and restored back upon Return.
The register is actually made out of D-type flip-flops (74ACT74) fed from the S-BUS. The outputs go to another bus (called CS-BUS) wired in the Control Slots; this bus is always open so the current status is always available to Controller cards. Flags are latched selectively using signals LD_FZ, LD_FN, LD_FC and/or LD_FV produced by IDS cards during the last cycle of those instructions that affect flags.
Instructions and Flags
Although further analysis on this topic is still pending , I can anticipate the following:
-- ALU instructions affect all flags (Z,N,C,V).
-- Data transfer instructions (MOV, LD, STO, PUSH, POP) affect flags Z, N.
-- Increment/Decrement instructions affect flags Z, N, V.
-- Branch instructions affect none flag.
By not affecting flags, I mean that the previous status remains. The programmer needs to take this into account when placing conditional branch instructions within the code.
The Interrupt Enabled condition
The necessity of recording the Interrupt Enabled condition as a flag has to do with nested interrupts. When an interrupt service routine (lets call it: ISR1) gets interrupted by a highest priority interrupt (ISR2), the Interrupt Controller disables interrupts before passing control to ISR2. If this routine failed to enable interrupts back, then interrupts would remain disabled when control returns to ISR1, which is not the intended behavior. But, by remembering the Interrupt Enable condition in the Flags register, interrupts will be automatically restored upon return since F had been saved to the Stack.
Thus there is a flip-flop in F for the Interrupt Enable condition, only that its input (SI) and output (CSI) are not wired with the S-BUS and CS-BUS respectively but treated as point-to-point connections. This is because only a few circuits will make use of them; those circuits are: the Interrupt Controller, the IDS card responsible for the DI and EI instructions and the Control Panel.
CPU BACKPLANE
The CPU backplane is constructed on a prototyping board holding six 96-pins DIN41612 female connectors and other six 120-pins DIN41612 female connectors. This divides the backplane into two sections: Data Slots and Control Slots respectively. The former is used for "data oriented cards" (such as registers) and the latest is used for "controller cards".
Each of the two Slot types are wired separate. Most of the wires conforms different buses whereas others serve for point-to-point inter-card connections.
A special card named "Master Controller" features two connectors (one 96-pins and the other 120-pis) and plugs to both Slot types. This card contains those circuits that need access to the two worlds such as the Instruction Register (IR), the "Arbitrer" and others. It also provides the interface (buffering) with the external bus (U-BUS).
Following is the pinout for both Slot types:
Data Slots
- - - - - - - - - - - - - -
A B C
- - - - - - - - - - - - - -
1 GND GND GND
2 D0 PP D8
3 D1 PP D9
4 D2 PP D10
5 D3 PP D11
6 D4 PP D12
7 D5 PP D13
8 D6 PP D14
9 D7 PP D15
10 L0 PP L8
11 L1 PP L9
12 L2 PP L10
13 L3 PP L11
14 L4 PP L12
15 L5 PP L13
16 L6 PP L14
17 L7 PP L15
18 RST PP L16
19 FLT PP L17
20 SZ PP L18
21 SN PP L19
22 SC PP L20
23 SV PP CLK
24 A7 PP A15
25 A6 PP A14
26 A5 PP A13
27 A4 PP A12
28 A3 PP A11
29 A2 PP A10
30 A1 PP A9
31 A0 PP A8
32 +5V +5V +5V
- - - - - - - - - - - - - -
Signals Descriptions:
DO-15 Internal Data Bus
A0-15 Internal Address Bus
L0-20 Internal Lamps Bus
SZ Set Conditional Status Zero
SN Set Conditional Status Negative
SC Set Conditional Status Carry
SV Set Conditional Status Overflow
RST System Reset
CLK System Clock
FLT Fault Condition
PP Point-to-Point Control Signals
Control Slots
Except those marked as "PP" (Point to Poin), all signals in Control Slots are wired together in a Bus.
Signals marked as CTL (Control) are not designated yet but they will as the design progresses.
- - - - - - - - - - - - - -
A B C
- - - - - - - - - - - - - -
1 GND GND GND
2 IR0 PP IR8
3 IR1 PP IR9
4 IR2 PP IR10
5 IR3 PP IR11
6 IR4 PP IR12
7 IR5 PP IR13
8 IR6 PP IR14
9 IR7 PP IR15
10 CTL CTL CTL
11 CTL CTL CTL
12 CTL CTL CTL
13 CTL CTL CTL
14 CTL CTL CTL
15 CTL CTL CTL
16 CTL CTL CTL
17 CTL CTL CTL
18 RST CTL CTL
19 FLT CTL CTL
20 CSZ LD_FZ CTL
21 CSN LD_FN CTL
22 CSC LD_FC CTL
23 CSV LD_FV CLK
24 CTL CTL CTL
25 CTL CTL CTL
26 CTL CTL CTL
27 CTL CTL CTL
28 CTL CTL CTL
29 CTL CTL CTL
30 CTL CTL CTL
31 CTL CTL CTL
32 CTL CTL CTL
33 CTL CTL CTL
34 CTL CTL CTL
35 CTL CTL S1
36 CTL CTL S0
37 CTL CTL EOE
38 CTL CTL ET1
39 CTL CTL ET0
40 +5V +5V +5V
- - - - - - - - - - - - - -
Signals Descriptions:
IR0-15 Instruction Register Output
CSZ Conditional Status Zero
CSN Conditional Status Negative
CSC Conditional Status Carry
CSV Conditional Status Overflow
LD_FZ Load Flag Zero
LD_FN Load Flag Negative
LD_FC Load Flag Carry
LD_FV Load Flag Overflow
S0, S1 Operational Status
ET0, ET1 Enconded Time (T1, T2, T3, T4)
RST System Reset
CLK System Clock
FLT Fault Condition
CTL Control Signals (Bus)
PP Control signals (Point-to-Point)
Encoded Time:
- - - - - - - - -
ET1 ET0 Time
- - - - - - - - -
0 0 T1
0 1 T2
1 0 T3
1 1 T4
- - - - - - - - -
Operational Status:
- - - - - - - - - - - - - - - - - - - -
S1 S0 Operational Status
- - - - - - - - - - - - - - - - - - - -
0 0 Halt
0 1 Fetch
1 0 Execute
1 1 Interrupt being negotiated
- - - - - - - - - - - - - - - - - - - -
|