If MARIE's architecture were extended to include a shift operation, the machine would gain a direct way to move bits within a value—typically shifting a register or memory word left or right by one position—thereby making multiplication and division by powers of two, bit-masking, and serialization tasks far more natural; but because MARIE is a deliberately minimal teaching architecture, adding a shift instruction requires deciding where it lives in the 16-bit instruction format, how it interacts with the existing AC (accumulator) and MBR (memory buffer register), and whether the net benefit justifies departing from the standard textbook design. The precise answer depends on which MARIE edition (the classic Null–Lobur presentation, an instructor's variant, or a specific simulator) and which shift semantics you intend—logical, arithmetic, or rotate—none of which the bare query specifies.

What MARIE Actually Is

MARIE (Machine Architecture that is Really Intuitive and Easy) is the pedagogical computer model introduced by Linda Null and Julia Lobur in The Essentials of Computer Organization and Architecture. It is a 16-bit machine with a very small instruction set, a 16-bit-wide instruction word, and a register set that includes the accumulator (AC), the memory address register (MAR), the memory buffer register (MBR), the program counter (PC), and the instruction register (IR). The 16-bit instruction format splits into a 4-bit opcode and a 12-bit address field, which limits it to 16 distinct opcode values and a 4096-word addressable memory.

In the standard Null–Lobur instruction set, the opcodes are:

Opcode (binary) Mnemonic Meaning
0000 JnS Jump and Store (subroutine linkage)
0001 Load Load AC from memory
0010 Store Store AC to memory
0011 Add Add memory to AC
0100 Subt Subtract memory from AC
0101 Input Input to AC
0110 Output Output from AC
0111 Halt Terminate program
1000 Skipcond Skip on condition
1001 Jump Unconditional jump
1010 Clear Clear AC
1011 AddI Indirect add
1100 JumpI Indirect jump
1101 LoadI Indirect load
1110 StoreI Indirect store
1111 (unused) —

That 1111 slot is the obvious place to put a new instruction if you are extending the standard design, but it is only one slot, which is the binding constraint.

What a Shift Instruction Would Have to Specify

A "shift" is not one operation but a family. Extending MARIE requires picking a member of the family, or several:

Logical left shift moves bits toward the most significant end and fills the vacated bit with 0. This multiplies an unsigned integer by 2 (modulo 2^16). Logical right shift moves bits toward the least significant end, filling with 0. This divides an unsigned integer by 2, discarding the remainder. Arithmetic shift preserves the sign bit so that signed values remain signed: arithmetic right shift replicates the sign bit into the vacated positions, which corresponds to floor division by 2 for two's-complement numbers. Arithmetic left shift coincides with logical left shift in bit pattern but can overflow into the sign. Rotate (circular shift) feeds the shifted-out bit back into the vacated position, useful for cryptography and bit-counting algorithms.

In most classroom extensions, "shift" is taken to mean a left shift of the AC by one bit (sometimes called SHL or SAL). Others include a right shift (SHR). Some include both, distinguished by a bit in the instruction word. Because the query does not say which, any concrete answer needs to name its choice. The discussion below assumes the common choice—a one-bit AC shift—and notes where the others would differ.

Why the Constraint Is Structural, Not Cosmetic

MARIE's instruction word is 16 bits, split 4/12 as opcode/address. The 4-bit opcode is a hard ceiling of 16 instructions, already exhausted in the Null–Lobur design. Any new instruction therefore has three routes:

1: Repurpose the unused 1111 opcode. Put SHL (or a shift-with-modifier encoding) there. This is the smallest change: no new register, no format change, and it stays consistent with the existing addressing scheme. The catch is that the 12-bit address field becomes semantically irrelevant for shift, so the design should specify that the field is ignored (or used as a shift-amount field). 2: Widen the opcode. For example, split the 16-bit word into a 6-bit opcode and 10-bit address, allowing 64 instructions but shrinking addressable memory to 1024 words. This changes MARIE's memory layout and is usually considered a different, larger machine. 3: Use the address field as an operand. Keep the 4-bit opcode and interpret the 12-bit field as a shift count, a shift direction, or a mask. For instance, bit 11 could select direction and bits 10–0 the count. This is elegant but couples shift semantics to the address encoding, so a shift instruction cannot also use the implicit "shift by one" behavior that makes textbook examples tidy.

Most published classroom variants choose option 1 because it is minimal and does not perturb the rest of the architecture. The cost is that shift must be a one-bit operation, which changes how loops are written.

Consequences for Programs

The most visible consequence is in multiplication and division. Without shift, MARIE programs that multiply two numbers do so by repeated addition: a loop that adds the multiplicand B times is O(B) rather than O(log B). With a left shift instruction, multiplication by small constants becomes linear in the number of bits set in the multiplier, and division by two becomes a single shift.

Worked Example: Multiply by 4 Without Shift

In standard MARIE, multiplying AC by 4 requires either four Add operations (if the value is already in AC) or, more generally, a loop. A typical pattern stores the operand in a memory variable, clears AC, then adds it repeatedly. For multiply-by-4, a program might look like:

Worked Example: Multiply by 4 With SHL

With a one-bit SHL at 1111, the same computation is:

The instruction count drops, but the semantic gain is larger than the count suggests: the second program is O(log k) in the multiplier k rather than O(k), and it correctly follows bit patterns rather than repeated addition.

For multiplication of arbitrary 16-bit values, shift alone is not enough—a shift-and-add loop is the standard algorithm—but the loop's inner step is now a shift plus a conditional add, which is exactly the classic "peasant multiplication" algorithm.

Overflows, Sign, and the Register Side-Effects That Matter

A shift instruction must specify what happens to the bit shifted past the register boundary. In MARIE, the AC is 16 bits wide, so a left shift of the AC discards the old bit 15 (the most significant bit) and inserts 0 at bit 0. If the architecture is two's-complement and bit 15 is the sign, a left shift of a negative number produces a wrong-signed result unless the program accounts for it. That is expected: shift instructions in real ISAs likewise do not flag overflow unless an overflow flag exists, and MARIE has no condition flags in the standard design—only the Skipcond instruction, which tests AC against zero or the sign bit.

A subtle point: Skipcond in Null–Lobur tests AC's relation to zero (000 for AC < 0, 400 for AC = 0, 800 for AC > 0, in memory-operand terms). Adding a shift instruction does not give you an overflow flag; you must still check for overflow manually (for instance, by comparing operands before the shift). A program that blindly shifts left and then tests Skipcond for sign will get the right answer only when no overflow occurred. This is a design limitation of MARIE itself, not of the shift addition, and it is worth stating explicitly in any assignment that adds shift.

Right shift has its own semantics problem. A logical right shift of a negative two's-complement number produces a large positive number—usually not what the programmer wants. Arithmetic right shift (sign-propagating) is the standard alternative, but then the design must say whether the instruction is arithmetic or logical and how the programmer selects between them. One common classroom solution: use the unused bit(s) in the 12-bit field to select among SHL, SHR (logical), and SAR (arithmetic). That keeps the 4-bit opcode but adds a small "shift type" subfield, which is a good example of stretching an existing format rather than replacing it.

Timing and Datapath Implications

Additions to the ISA usually come with minimal changes to the datapath, but shift is not free. A shift can be implemented:

As a microcoded sequence: the same ALU passes the AC through a shifter or performs two add operations (for a left shift: AC + AC; for a right shift: a divide-by-two substitute). Microcoding a shift as "AC ← AC + AC" for a left shift is the classic minimal-hardware trick: no new ALU operation, only a control signal that bypasses memory and selects AC as both operands. As a new ALU operation selected by an ALU-op control signal. This is clean but adds control lines. As a dedicated shifter on the AC path. This is what real CPUs do.

The "AC + AC" trick is worth highlighting because it shows that a shift instruction does not always require a new datapath—only a new control path. In Null–Lobur's register-transfer notation, a left shift becomes "AC ← AC + AC," and a right shift becomes "AC ← AC / 2" if the ALU supports it, or a bit-serial routine otherwise. The register-transfer-level (RTL) microoperation would appear as a new line in the instruction cycle description, for example "SHL: AC ← shift_left(AC)."

Interaction With Addressing Modes

MARIE has three addressing modes: direct, indirect, and immediate (in the sense that some instructions operate on the AC only). A shift instruction fits the "implied addressing" pattern: the operand is AC, not memory. That has a consequence for the address field: it carries no useful information, so the instruction's encoding must explicitly mark the field as "don't care." In Null–Lobur's convention, "don't care" address fields are common—Halt has none, Clear has none, Skipcond uses a subfield. A shift instruction is thus more like Clear than like Load.

One common student error is to write "SHL X" (shift memory location X) when the instruction shifts the AC. The architecture must specify, unambiguously, that shift operates on AC and that the address field, if present, is either ignored or repurposed. Assignment answer keys that mark "SHL X" as wrong should be interpreted as insisting on the implied-operand definition, not as a claim that shift-to-memory is impossible in general—real machines do have both forms.

Where the Extension Stops Being "MARIE"

A useful discipline when extending MARIE is to ask: does this change break the machine's stated teaching purposes? Null and Lobur emphasize a simple, comprehensible architecture. If you add shift, you must update:

The instruction set table to include SHL (and, if used, SHR/SAR plus shift-count encoding). The instruction cycle / microoperation list so the fetch-decode-execute stages clearly describe the shift step. The assembler to recognize the new mnemonic and the operand syntax. Example programs so that textbook demonstrations remain consistent. Any simulator or diagram (including the RTN and the RTL chart).

If any one of these is omitted, the extension is not a coherent architecture; it is a program-level hack. That distinction is common in coursework: students often write pseudocode with SHL but do not update the ISA table, which is inconsistent.

A second boundary: MARIE does not have a shifter in the standard block diagram, and adding one changes the "minimal" story. Instructors sometimes accept the "AC + AC" encoding as a way to add shift without a new datapath, precisely because it can be described in the existing ALU diagram as an add with a control signal selecting the AC twice. That is the most defensible minimal extension.

A Concrete Encoding Proposal (Illustrative)

The following is an illustrative design choice, not a claim about what any particular simulator does:

Opcode 1111 reserved for shift-family instructions. Bits 11–10 (within the 12-bit field) select type: 00 = logical left, 01 = logical right, 10 = arithmetic right, 11 = reserved. Bits 9–0 encode a count 0–1023; count 0 can mean "shift by 16" or be defined as "no-op," which must be specified.

This encoding preserves the 16-bit word and uses only the unused opcode. It is reproducible arithmetic: a 16-bit AC shifted left by n is (AC << n) mod 2^16; right shift is either floor(AC / 2^n) for logical (unsigned interpretation) or a sign-propagating operation for arithmetic, and the illustration assumes the value is the raw 16-bit pattern.

Alternatively, a simpler design keeps SHL one-bit-only and uses the 12-bit field as a mask or as "don't care," matching textbook minimalism. Both are legitimate; they encode different intentions.

Common Confusions and Distinctions

Several ambiguities repeatedly surface in discussions of "MARIE with shift":

MARIE vs. MIPS vs. RISC-V. MARIE is a single pedagogical model. If someone says "MARIE already has shift," they may be thinking of MIPS (sll, srl, sra) or RISC-V (sll, srl, sra), whose instruction sets include shift instructions and whose formats accommodate them. MARIE's 16-bit, 4/12 format does not, so "MARIE has shift" is false unless explicitly a variant. Simulator differences. Several educational simulators (e.g., MARIE.js and similar tools) have their own instruction sets. Some subsets may include additional instructions or extensions; claiming a shift instruction exists in "the simulator" requires naming the version, which the query does not. The safe statement is: the classic Null–Lobur MARIE does not include a shift, and adding one requires the design decisions above. Instruction vs. macro. A "shift" implemented as a subroutine of Adds is a macro, not an instruction. It is much slower (O(n) in the word width for repeated add) and it does not enlarge the ISA. Assignments asking "add a shift instruction" should be read as requiring an ISA change, not a macro. Shift vs. rotate. These are easy to conflate. Rotate preserves all bits; shift discards one. In bit-manipulation tasks like parity computation, the difference is decisive. Immediate shift count vs. register shift count. MARIE has no general-purpose register file beyond AC, so a "register shift count" is not natural; a count in the instruction word is the MARIE-idiomatic choice.

The Practical Bottom Line for Each Reader

If you are a student answering a homework question about adding shift to MARIE: state which opcode you are using (typically 1111), define the operand as AC, specify direction and count semantics, and update the RTL cycle. Explain that adding a shift widens program expressiveness but requires either reusing the spare opcode or changing the format. If you are an instructor designing a lab: the AC-plus-AC cleverness for logical left shift is a compact way to add shift without a new diagram, and it forces students to think about overflow and sign. If you are comparing architectures: MARIE's lack of shift is a deliberate simplification. On real machines, shifts are cheap and ubiquitous; on MARIE, they are an optional pedagogical extension whose value depends on what you want students to learn next—bitwise algorithms, two's complement, or microcoded control.

The question also leaves unresolved whether the intended "shift" is by one bit or by a variable count, whether it includes right shifts, and whether it must apply to memory as well as AC. Those are the unknowns. What is answerable is the shape of the design decision: any shift added to MARIE must live at or near the 1111 slot (or force a format change), must be defined as an AC operation under direct semantics, must specify fill and sign behavior, and must be accompanied by updates to the instruction-cycle description if it is to be a coherent architecture rather than a pseudocode convenience.