Chapter 6CPU, Memory, and I/O

This chapter first describes the design of a simple Central Processing Unit (CPU). Since the basic CPU contains a set of registers, an Arithmetic Logic Unit (ALU), and a Control unit, design of these components are covered. Also, in this chapter, basic concepts of memory organization and Input/Output (I/O) techniques associated with typical microcontrollers are described.

6.1 Design of the CPU

As mentioned before, the CPU contains three elements: registers, ALU (Arithmetic Logic Unit), and control unit.

Since programs contain instructions and data, the register section of the CPU contains four basic registers to hold instructions, data, and their corresponding addresses. These registers are: Instruction Register (IR), Program Counter (PC), Memory Address Register (MAR), and General Purpose Register (GPR).

The Instruction Register (IR) stores instructions. The contents of the instruction register are always translated by the CPU as an instruction. After reading (fetching) an instruction from memory, the CPU stores it in the instruction register. The instruction is decoded (translated) internally by the CPU, which then performs the required operation.

The program counter contains the address of the instruction. The program counter normally contains the address of the next instruction to be executed.

The Memory Address Register (MAR) contains the address of data. The CPU uses the address, which is stored in the memory address register, as a direct ...

Get Fundamentals of Digital Logic and Microcontrollers, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.