5 DERECHA
Memory & CPU 본문
(1) Integrated circuit
IC stands for "integrated circuit," which is a miniaturized electronic circuit that can be used to perform various functions in electronic devices. One common type of IC that uses flip-flops and latches is a "sequential logic circuit."
A flip-flop is a circuit that can store a single bit of information, either a 0 or a 1. There are several different types of flip-flops, but one common type is the D flip-flop. This type of flip-flop has a data input (D), a clock input (CLK), and an output (Q). When the clock input changes from low to high (rising edge), the flip-flop stores the value of the data input at that moment and outputs it on the Q output. This stored value remains on the Q output until the next rising edge of the clock input, when it is updated with the new value on the data input.
A latch is a similar circuit to a flip-flop, but it has an additional input called the enable input (EN). When the enable input is high, the latch behaves like a flip-flop and stores the value on its data input. When the enable input is low, the latch "latches" onto the current value and holds it on its output, regardless of any changes on the data input.
In an IC, multiple flip-flops or latches can be combined to create more complex circuits, such as counters, shift registers, or memory arrays. These circuits can be used to store and manipulate binary data, perform arithmetic operations, or control the behavior of electronic systems. Sequential logic circuits are often used in microprocessors, digital signal processors, and other digital circuits to implement complex algorithms and signal processing tasks.
The difference between a latch and a flip-flop is that a latch is level-triggered (outputs can change as soon as the inputs changes) and Flip-Flop is edge-triggered (only changes state when a control signal goes from high to low or low to high)
.
(2) Register
A register is a small amount of high-speed memory in a computer's central processing unit (CPU) that is used to hold data temporarily while the CPU processes it. Registers are used for a variety of purposes in a CPU, including holding instructions, storing operands for arithmetic and logic operations, and maintaining the state of the CPU.
There are two main types of registers in a CPU: general-purpose registers and special-purpose registers.
General-purpose registers (GPRs) are registers that can be used for any purpose, such as holding data for arithmetic or logical operations, storing memory addresses, or holding function arguments and return values. These registers are typically accessible by the programmer and can be used for a wide range of tasks.
The number and size of GPRs in a CPU vary depending on the architecture of the CPU. For example, the x86 architecture used in many modern desktop and laptop computers has eight 32-bit GPRs, while the ARM architecture used in many mobile devices has 16 32-bit GPRs.
Special-purpose registers (SPRs) are registers that are used for specific tasks in the CPU. These registers are typically not directly accessible by the programmer and are used by the CPU to perform specific functions. Examples of SPRs include the program counter (PC), which holds the address of the current instruction being executed, the instruction register (IR), which holds the current instruction, and the status register, which holds flags that indicate the state of the CPU (such as whether a particular operation resulted in a zero or overflow condition).
SPRs are often used for performance optimization in CPUs. For example, some CPUs have registers that are optimized for performing floating-point operations or for accelerating graphics processing. Other CPUs use SPRs to manage the flow of instructions and data between the CPU and other components of the computer, such as the memory or input/output devices.
General-urpose input/output (GPIO) refers to the pins or ports on a microcontroller or microprocessor that can be programmed to be either inputs or outputs. GPIO pins can be used to interface with external devices, such as sensors, switches, and LED displays.
When working with GPIO, there are several types of registers that are commonly used:
1) Address register: This register is used to specify the address of the GPIO port or pin that is being accessed.
2) Data register: This register is used to read or write the value of the GPIO pin. When the pin is configured as an input, reading the data register will return the current state of the pin. When the pin is configured as an output, writing to the data register will set the state of the pin.
3) Instruction pipeline register: This register is used to hold instructions that are being executed by the CPU. The instruction pipeline allows the CPU to execute multiple instructions simultaneously, improving overall performance.
Special-purpose registers (SPRs) are registers that have specific functions in a CPU. Some common SPRs include:
1) Program counter (PC): This register holds the address of the next instruction to be executed.
2) Stack pointer (SP): This register holds the address of the top of the stack. The stack is used to store data temporarily during function calls and other operations.
3) Linked register (LR): This register is used to store the return address from a subroutine or function call.
4) Status register: This register holds flags that indicate the current state of the CPU, such as whether an arithmetic operation resulted in a carry or overflow condition.
SPRs are typically not directly accessible by the programmer and are used by the CPU to manage the flow of instructions and data within the system.
Overall, both GPRs and SPRs play important roles in the operation of a CPU and are used to perform a wide range of tasks in modern computer systems. Understanding how these registers work and how to use them effectively is an important part of programming for embedded systems and microcontrollers.
'Embedded' 카테고리의 다른 글
Introduction of Makefile (0) | 2023.10.17 |
---|---|
임베디드 레시피 (0) | 2023.08.01 |
Hardware for Embedded System (0) | 2023.03.07 |