Skip to content
BetterDL

Write enable (WE)

Also called: register write enable, RegWrite

A control signal that permits a write: in a register file, the addressed register loads new data at the clock edge only when the write enable is on.

A write enable (W or WE) is the master switch for writing. In a register file, it is ANDed with every line of the write-address decoder to form the registers' load enables:

Lᵢ = W AND (address = i)

  • W = 1: at the next edge, the addressed register loads the write data.
  • W = 0: every load enable is 0, so every register holds.

Why it is needed: the write address and data lines always carry some value. Without W, the decoder would raise one load enable at every edge and overwrite a register every cycle. W lets the control unit write only during instructions that produce a result, such as ADD, and not during stores or branches.

It can be active-low (writing happens when W = 0), in which case the decoder lines are ANDed with instead.

If W is stuck at 1 by a fault, the addressed register is overwritten at every edge with whatever is on the data lines.

Memory chips use the same idea, with a write-enable pin that decides whether an access reads or writes; the memory topic covers those memory control signals.

Worked examples

Example

Active-low write enable

A 4-register file has write address A1 A0 and an active-low write enable W (writing happens when W = 0). Write register 1's load enable.

  1. 1.

    Register 1 is address 01: .

  2. 2.

    Writing is enabled when W = 0, i.e. when = 1.

  3. 3.

    L1 = .

Example

A write enable stuck at 0

A fault holds an active-high W at 0 permanently. What happens?

  1. 1.

    Every load enable is W ANDed with a decoder line, so every load enable is 0.

  2. 2.

    No register ever loads: every instruction's result is silently lost.

  3. 3.

    Reads still work, so the processor keeps reading the values the registers held when the fault began.

Common mistakes

  • Leaving W out of the load-enable logic.

  • Assuming W is active-high. Check for a bubble or a bar.

Practice Write enable (WE)

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Write enable (WE) is taught in Registers, Memory and Basic CPU / Computer Architecture.