중간 고사 review (part 1: high-level...

36
컴퓨터 개념 및 실습 중간 고사 review (Part 1: high-level overview) Bryan S. Kim

Upload: others

Post on 23-Feb-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

컴퓨터 개념 및 실습

중간 고사 review (Part 1: high-level overview)

Bryan S. Kim

Page 2: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Before we get started…

• Office hour change for this week

– 4/11 (Thurs.) instead of 4/12 (Fri.)

– 301-517, 16:30-17:30

• Midterm review (part 2, with exercises)

– 4/15 (Mon.), in class

– Both English and Korean will be used

Page 3: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Before we get started…

• Office hour change for this week

– 4/11 (Thurs.) instead of 4/12 (Fri.)

– 301-517, 16:30-17:30

• Midterm review (part 2, with exercises)

– 4/15 (Mon.), in class

– Both English and Korean will be used

Page 4: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Before we get started…

• Office hour change for this week

• Midterm review (part 2, with exercises)

• Midterm on 4/17 (Wed.)

– Closed-book, closed-notes

– Bring your ID

– Only your writing utensils will be allowed on your desk

– All exam questions will be variations of the textbook exercises

Page 5: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

The entire course in a nutshell

• The underlying structure of a computer

– Chap 1~Chap 10

• Programming in a high-level language

– Chap 11~Chap 19

Page 6: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

My interpretation of the textbook

A computing system &

data representation

Chap 1~2

Page 7: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

My interpretation of the textbook

A computing system &

data representation

Digital logic

Von Neumann machine

LC-3 ISA

Assembly language

Service routines & subroutines

Doing cool stuff with assembly

… want to do cooler stuff

Chap 1~2

Chap 3~10

Page 8: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

My interpretation of the textbook

A computing system &

data representation

Digital logic

Von Neumann machine

LC-3 ISA

Assembly language

Service routines & subroutines

Doing cool stuff with assembly

C language

Functions

Doing cooler stuff with C

… want to do cooler stuff

Chap 1~2

Chap 3~10

Chap 11~19

Page 9: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

What this course touches upon

from cse.snu.ac.kr

Page 10: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap. 1

• Abstraction

– What does it hide?

– What does it expose?

– Interface and implementation

Page 11: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap. 1

• Abstraction

• Hardware vs. software

– How machines are built and programmed

– How programs are built on top of machines

Page 12: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap. 1

• Abstraction

• Hardware vs. software

• Universal computing device

– Big or small, capabilities are the same

• Efficiency, that’s another story

– The reason why we are studying LC-3

Page 13: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 2.

• Integer representation

– Sign-magnitude

– 1’s complement

– 2’s complement

Page 14: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 2.

• Integer representation

• Operations

– Arithmetic

• Add, subtract, sign-extension, overflow

– Logical

• AND, OR, NOT, NAND, NOR

Page 15: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 2.

• Integer representation

• Operations

• Other data types

– Floating point

– ASCII

Page 16: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 3.

• Transistors and logic gates

– NMOS, PMOS, CMOS

– NOT, NAND, NOR

– Truth table circuit (logical completeness)

– DeMorgan’s Law and other properties

Page 17: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 3.

• Transistors and logic gates

• Combinational logic

– Decoder

• n-bit to 2n-bit

– Mux

• Selects one to output among 2n inputs

– Adder

• 1-bit adder ripple-carry adder

Page 18: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 3.

• Transistors and logic gates

• Combinational logic

• Storage elements

– Latch gated latch register

– Memory

• A simplified (?) representation of what it could look like

Page 19: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 3.

• Transistors and logic gates

• Combinational logic

• Storage elements

• Sequential logic

– Flip-flop

• Like latch, but “holds” data

– Finite state machine

• Circuit State transition diagram

Latches, FFs, and registers are sometimes intermixed in literature, but we’ll go with the definition in the text.

Page 20: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 4.

• Von Neumann model

– Memory: MAR, MDR

– Processing unit: ALU, TEMP

– Control unit: PC, IR

– Input

– Output

Page 21: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 4.

• Von Neumann model

• Instruction processing

– Instruction fetch

– Instruction decode

– Evaluate address

– Fetch operands

– Execute

– Store result

Page 22: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap. 5

• LC-3 ISA

– What does an ISA expose?

• Memory, registers, instructions

– LC-3 instruction format

Page 23: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap. 5

• LC-3 ISA

• LC-3 instruction types – Operate

• Register-to-register

• Register vs. immediate mode

– Data movement • Register-to/from-memory

• PC-relative vs. Base-offset vs. Indirect

– Control: PC change • Condition code

Page 24: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap. 5

• LC-3 ISA

• LC-3 instruction types

• Details in LC-3 ISA

– What goes on for each instruction for each instruction processing phase

Page 25: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 6.

• Problem solving

– Step-wise refinement

– Constructs

• Sequential

• Conditional

• Iterative

Page 26: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 6.

• Problem solving

• Debugging

– What a debugger should provide

– How to debug

• Step, breakpoint, watchpoint

– Types of mistakes

• Syntax, logic, data

Page 27: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 7.

• Assembly language syntax

– Instruction

– Label

– Comment

– Pseudo-op

Page 28: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 7.

• Assembly language syntax

• Assembly process

– Two-pass process

• Symbol table

• Location count

Page 29: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 8.

• I/O (device) CPU

– Device register

– Memory-mapped vs. special instructions

– Sync vs. async

– Polling vs. interrupt

Page 30: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 8.

• I/O (device) CPU

• LC-3 computer’s keyboard & monitor I/O

– Memory-mapped, asynchronous, polling

– Hardware-software synchronization

• What the device hardware does

• What the software should do

Only polling is covered in this chapter.

Page 31: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 9.

• System call mechanism

– System control block

– What happens on TRAP?

– What happens on RET (JMP R7)?

Page 32: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 9.

• System call mechanism

• Subroutine

– What happens on JSR/R?

– How do we pass arguments and get return values from subroutines?

Page 33: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 10.

• Stack

– What it is, how it works, how to implement.

Page 34: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Important ideas from Chap 10.

• Stack

• Interrupt handling

– Processor state

• Particularly, Processor Status Register (PSR), Saved.SSP and Saved.USP

– What happens on jumping into interrupt service routine (ISR)

– What happens on return from interrupt (RTI)

What the ISR exactly does isn’t extensively covered in text. How to decide between polling and interrupt isn’t covered in detail, either.

Page 35: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Why are we learning hardware?

Page 36: 중간 고사 review (Part 1: high-level overview)archi.snu.ac.kr/courses/under/19_spring_computer_concept/... · 2019-07-12 · •Transistors and logic gates •Combinational logic

Why are we learning hardware?

J. H. Hennessy and D. A. Patterson, “A New Golden Age for Computer Architecture” in CACM 2019