논리회로 및 설계(1)

Chaper 01 From Zero to One

수업의 목적

  • 컴퓨터 내부에 대해서 배운다.
  • 디지털 설계에 대한 원칙에 대해서 배운다.
  • 마이크로프로세서를 설계 및 구축한다.

Digital Discipline: Binary(이진)

다음과 같은 분리된 두가지 value를 고려한다

  • 1, True, High
  • 0, False, Low

수의 체계 (Number Systems)

  • Decimal Numbers (십진수) - ex. 5374
  • Binary Numbers (이진수) - ex. 1101
  • Hexadecimal Numbers (16진수) - 이진수를 짧게 표현한것, ex. 4AF

5374(10진수) = 5x10^3 + 3x10^2 + 7x10^1 + 4x10^0

1101(2진수) = 1x2^3 + 1x2^2 + 0x2^1 + 1x2^0 = 13(10진수)

4AF(16진수) = 0100 | 1010 | 1111(2진수)

  • 수의 범위 - 십진수: [0, 10^N - 1], 이진수: [0, 2^N-1]

Bits, Bytes, Nibbles ...

  • Bits - 10010110, 가장 앞에 있는 bit: Most Significant Bit(MSB), 가장 마지막에 있는 bit: Least Significant Bit(LSB)
  • Bytes & Nibbles - 10110110에서 0110:nibble(4bits), 전체: 1byte(8bits)
  • Bytes - CEBF9AD7에서 CE: 1 byte, C: nibble

Addition (더하기)

(이진수) 1011 + 0011 = 1110 (올림수-carries 발생)

1011 + 0110 = 10001 : Overflow(오버플로우, 넘침)현상 발생, 4bit로 표현할 수 없음!

Signed Binary Numbers(부호를 가진 수의 표현)

Sign/Magnitude Numbers(부호/절대값)

Sign bit는 MSB, Negative number: sign bit = 1, Positive number: sign bit = 0

N-bit 부호/절대값의 범위: [-(2^(N-1)-1), 2^(N-1)-1]

ex. 1101 = -5, 0101=+5

하지만 다음과 같은 문제가 발생한다.

  • Addition doesn't work: 1101 + 0101 = 10010 (-5+5!=0)
  • Two representations of 0: 1000, 0000은 똑같은 0

Two's Complement Numbers(2의 보수)

MSB는 -2^N-1의 value를 가진다.

ex. Most positive 4-bit number: 0111(7), Most negative 4-bit number: 1000(-8)

N-bit 부호/절대값의 범위: [-2^(N-1), 2^(N-1)-1]

 

2의 보수 표현에서 음수화 작업하는 방법

  1. Invert the bits
  2. Add 1

ex. 0111 -> 1000 -> 1001

Logic Gates

inversion(NOT), AND, OR, NAND, NOR, etc..

트랜지스터(Transistor)

: Three-ported voltage-controlled switch

  • nMOS transistor: pass good 0's, so connect source to GND
  • pMOS transistor: pass good 1's, so connect source to VDD

'cs지식' 카테고리의 다른 글

HTTP와 HTTPS의 차이점  (0) 2022.09.01