728x90
반응형
ALU 구조
- inputs
- 32-bit input A
- 32-bit input B
- 2-bit operation selector S : ALU가 할 수 있는 동작 중 무슨 동작을 할지 선택
- 총 4개의 동작으로 이루어져있기에 2bit로 표현 가능
- Outputs
- 32-bit result R
- 동작 (S값에 따라서)
- S가 0b00일 때, R = A + B (addition)
- S가 0b01일 때, R = A & B (bitwise AND)
- S가 0b10일 때, R = A | B (bitwise OR)
- S가 0b11일 때, R = A ^ B (bitwise XOR)
ALU Design
- Splitting Bits
- 각 bit를 split해서 별도의 ALU Gate에 넣고 나중에 다시 recombine하는 방식으로 디자인함으로써 여러 bit 연산을 지원하는 장치를 만들 수 있습니다.
- Arithmetic Operation
- Logic gate를 사용해서 4개의 arithmetic opeartion을 지원합니다.
- 32-bit adder: 1 bit adder 32개를 chain 형태로 묶어서 32bit 연산을 가능하게 합니다.
- 32-bit AND, OR, XOR gates: Input을 split해서 32개를 각각 bitwise operation한 뒤에 다시 merge해서 out으로 출력합니다.
- Logic gate를 사용해서 4개의 arithmetic opeartion을 지원합니다.
- Selecting Operation
- multiplexer(mux)를 통해 동작을 선택합니다.
ALU Circuit
mux를 통해서 4개의 연산 중 하나의 연산을 선택하는 방식으로 하나의 ALU에서 여러 연산을 지원합니다.
728x90
반응형
'Computer Science > Computer Architecture' 카테고리의 다른 글
[Computer Architecture] Multiplication for computers (1) | 2024.02.28 |
---|---|
[Computer Architecture] RISC-V overflow (1) | 2024.02.27 |
[Computer Architecture] Arithmetic for computers (0) | 2024.02.08 |
[Computer Architecture] Instructions: Language of the computer - 2 (0) | 2024.02.07 |
[Computer Architecture] Instructions: Language of the computer - 1 (0) | 2024.02.06 |