• Negative Numbers

    • Signed Magnitude (sign)(magnitude) -(2^n-1 -1) ~ +(2^n-1 -1) ex) 1001: -3 ex) 0111: +7
      • addition
        • 동일 부호: 크기만 더하기
        • 반대 부호: 크기 절대값 차이로 계산 후 부호 결정
      • subtraction: 부호 바꿔 더하기
    • 1’s complement n bit → (2^n -1) - number; 각 자리 반전 ex) 10010 ↔ 01101
    • +0과 -0 다름
      • addition 부호까지 더하기 초과되는 carry를 전체 합에 더하기

        • overflow: 맨 앞의 carry 두개가 다르면 발생

        Untitled

      • subtraction 부호 바꿔(보수 취해서) 더하기

    • 2’s complement = 1’s complement +1
      • addition 부호까지 더하기 초과 carry 무시!

        • overflow: 맨 앞의 carry 두개가 다르면 발생

        Untitled

        • overflow detector

        Untitled

      • subtraction 부호 바꾸고(보수 취하고) 덧셈

  • Adders

    • Half Adder 반가산기 input carry 없음

      Untitled

    • Full Adder 전가산기 input carry, output carry 존재 HA두개로 만든다

      Untitled

    • Ripple Adder 리플 가산기 carry가 전달되면서 여러 비트의 숫자의 덧셈이 가능

      Untitled

    • Ripple Subtractor X-Y = X+(-Y) = X+Y’+1 여기서 Y’: 입력 반전 그리고 +1: input carry =1

      Untitled

    • Ripple Calculator

      Untitled

    • Carry Lookahead Adder 캐리가 전달되면서 생기는 delay 무시 O(n^2) gate, O(1) delay: 복잡하지만 빠르다!

      Untitled

      Untitled

  • Binary Multiplier 곱셈 = 덧셈의 연속 Ripple Adder 여러개와 AND array 사용

    Untitled

    Untitled

  • ALU(Arithmetic Logic Unit)

    • Arithmetic Unit

      Untitled

      Untitled

    • Logic Unit bitwise logic operations 4비트면 아래의 회로 4개를 사용해서 만든다

      Untitled

    • ALU 다양한 operation을 지원한다.

      Untitled

      Untitled