Patent ID: 7221604

Claim:
A memory structure with a repair function, comprising: a main memory unit having a plurality of main memory spaces; a register file having a plurality of backup memory spaces, wherein the number of bits in each backup memory space is the same as the number of bits in each main memory space; a record control unit coupled to the main memory unit and the register file for storing fault information of the main memory unit, wherein, upon receiving an access command, the record control unit determines if the main memory space pointed by the access command is faulty according to the fault information, and if the main memory space pointed by the access command is faulty, a backup memory space is selected from the register file to replace the defective main memory space; and a re-buffer multiplexer coupled to the data input/output terminal of the main memory unit and the data output terminal of the register file, wherein if the main memory space pointed by the access command is faulty, the register file is accessed through the re-buffer multiplexer under the control of the record control unit; if the main memory unit is fault-free, the main memory unit is accessed through the re-buffer multiplexer, wherein the record control unit comprises: a programmable fault information storage array for storing the fault information of the main memory unit, and according to the fault information, determining if the received main memory space pointed by the access command is faulty; if the main memory space is determined to be faulty, a backup memory address corresponding to the defective main memory space and a decision signal are issued; and a clocking signal generation circuit coupled to the programmable fault information storage array for generating the required clocking signals for the main memory unit and the register file according to the decision signal; wherein the register file accesses the corresponding data through the re-buffer multiplexer according to the routing of the backup memory address.