WEEK1 Flashcards

1
Q

Architecture 가 무엇인가?

A

특정 프로세서가 이해하는 명령어들의 집합

프로그래머 관점에서 보는 컴퓨터

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Microarchitecture 가 무엇인가?

A

이러한 명령어(architecture)들의 집합을 실제로 어떻게 하드웨어로 구현할 것인지 에 대한 것

하드웨어 관점에서 보는 것

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Instructions (명령어) 를 직관적으로 정의하자면 ?

A

컴퓨터가 이해하는 말들

컴퓨터의 언어체계에서의 단어들

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

instruction set 을 직관적으로 정의하자면 ?

A

컴퓨터 언어체계에서의 단어 집합

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

명령어 ( instruction) 은 무엇과 무엇을 나타내는 가?

A

수행할 연산(operations)과 사용할 데이터(operand)를 나타냄

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

어셈블리 언어란 ?

A

사람이 읽을 수 있는 명령어 포맷/형식

human readable format of instructions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

기계어란 ?

A

기계가 읽을 수 있는 명령어 포맷/형식
(computer readable format)
(0과 1로 이루어져 있음)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

MIPS 프로세서를 배우는 이유는?

A

MIPS 프로세서가 인텔 계열의 프로세서 보다 더 단순하고 직관적이라서 배우기 쉽기 때문.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Architecture 를 설계한다는 의미는 ?

A

특정 프로세서가 이해하는 명령어들의 집합을 정의하고,

표현 형식 등을 정함

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

system call service >

1 in $v0 이 수행하는 시스템 호출서비스는 ?

A

$a0 에 있는 정수 출력

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

system call service >

3 in $v0 이 수행하는 시스템 호출서비스는 ?

A

$f12 에 있는 double 출력

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

system call service >

4 in $v0 이 수행하는 시스템 호출서비스는 ?

A

$a0 에 있는 string 출력 (null terminated string)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

system call service >

5 in $v0 이 수행하는 시스템 호출서비스는 ?

A

read integer

$v0 contains integer read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

system call service >

6 in $v0 이 수행하는 시스템 호출서비스는 ?

A

read float

$f0 contains float read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

system call service >

7 in $v0 이 수행하는 시스템 호출서비스는 ?

A

read double

$f0 contains double read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

system call service >

8 in $v0 이 수행하는 시스템 호출서비스는 ?

A

read string
$a0 는 input buffer 의 주소
$a1 은 maximum n of characters to read

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

system call service >

9 in $v0 이 수행하는 시스템 호출서비스는 ?

A

sbrk( allocate heap memory)

$a0 는 n of bytes to allocate
$v0 은 allocated memory 의 주소

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

system call service >

10 in $v0 이 수행하는 시스템 호출서비스는 ?

A

시스템 종료

exit

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q
high-level code
a = b + c  
# $s0=a, $s1=b, $s2=c

를 mips assembly code 로 바꾸고 각 요소를 설명하시오

A

add $s0, $s1, $s2

  • add : the mnemonic indicates what operation to perform
  • $s1,$s2 : source operands on which the operation is performed
  • $s0 : destination operand to which the result is written
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

high-level code
a = b + c - d;

를 mips assembly code 로 바꾸시오

A

add t, b, c

sub a, t, d

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

컴퓨터가 연산을 위해 operands 들을 가지고 오는 데 어디서 가지고 오는지 3가지를 쓰시오

A
  1. register
  2. memory
  3. immediate (hard coded, constants 즉치)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

How many registers MIPS have

A

32개의 32 bit register

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

한 개의 address 가 가리키는 memory block 은 몇 개의 비트를 hold 할 수 있는가

A

32 bits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

메모리 vs 레지스터 어떤 것 더 빠른가? 그 이유는 ?

A

레지스터.

프로세서 내에 있어서 접근이 더 빠르다. 메모리는 프로세서 밖에 있어서 접근이 더 느리다.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
The MIPS Register Set> $0 의 레지스터 넘버와 사용용도는 ?
- 0 | - constant value 0 (항상 0 을 담고 있음)
26
The MIPS Register Set> $at 의 레지스터 넘버와 사용용도는 ?
- 1 | - assembler temporary
27
The MIPS Register Set> $v0-$v1 의 레지스터 넘버와 사용용도는 ?
- 2-3 | - procedure return values
28
The MIPS Register Set> $a0-$a3 의 레지스터 넘버와 사용용도는 ?
- 4-7 | - procedure arguments
29
The MIPS Register Set> $t0-$t7 의 레지스터 넘버와 사용용도는 ?
- 8-15 | - temporaries
30
The MIPS Register Set> $s0-$s7 의 레지스터 넘버와 사용용도는 ?
- 16-23 | - saved variables
31
The MIPS Register Set> $t8-$t9 의 레지스터 넘버와 사용용도는 ?
- 24-25 | - more temporaries
32
The MIPS Register Set> $k0-$k1 의 레지스터 넘버와 사용용도는 ?
- 26-27 | - os temporaries
33
The MIPS Register Set> $gp 의 레지스터 넘버와 사용용도는 ?
- 28 | - global pointer
34
The MIPS Register Set> $sp 의 레지스터 넘버와 사용용도는 ?
- 29 | - stack pointer
35
The MIPS Register Set> $fp 의 레지스터 넘버와 사용용도는 ?
- 30 | - frame pointer
36
The MIPS Register Set> $ra 의 레지스터 넘버와 사용용도는 ?
31 | - procedure return address
37
mips 레지스터의 총갯수는 32개 이다. 그렇다면 32개의 레지스터를 구분하기 위해서 몇 개의 비트가 필요 한가?
5 bits | 2^5=32 이므로
38
레지스터, 캐시(L1-L3), 메인 메모리(DRAM), 세컨데리 메모리(Disk)중에서 온칩 메모리는 ?
레지스터, 캐시.
39
자주 사용되는 값들은 어디에 저장 되는가?
온칩 메모리
40
Word-addressable 메모리란?
32비트 단위로 주소를 할당하는 것
41
Word-addressable 메모리에서 하나의 주소공간은 총 몇 비트의 데이터를 갖는가?
32비트
42
word-addressable 메모리에서, 각각의 32비트는 하나의 유일한 주소를 갖는가 ?
yes
43
lw (load word) 는 어디에서 부터 어디로 데이터를 로드하는 것인가?
메모리 -> 레지스터
44
Base address + offset | ($0 + n ) 로 나타내는 메모리 표현 법은 ?
메모리 오프셋 표현법
45
1($0) 의 의미는 ?
$1 | 왜냐면 $0 + offset 1 이므로
46
lw $s3, 1($0) 의 의미는?
$0 레지스터내에 저장된 값(0x00000000)을 베이스로 해서 +1 (offset) 인 메모리 주소에 저장된 데이터를 register $3 으로 로드
47
sw (store word) 는 어디에서 어디로 데이터를 저장하는 것인가?
레지스터 -> 메모리
48
sw $t4, 0x7($0) | 의 의미는?
레지스터 $t4에 저장된 값을 $0 레지스터 내에 저장된 값 (0x00000000) 을 base 주소로 하여 offset 7 인 메모리 주소로 ( word 7) 저장
49
byte addressable memory 란?
byte 단위(8비트) 로 주소가 할당되는 메모리
50
byte addressable memory 에서 load/store bytes 의 neumonic 은 ?
lb, sb
51
어셈블리 언어로 표현하시오 (word addressable memory/ byte addressable memory) Read memory word 1 into $s3
lw $s3, 1($0) # word-addressable lw $s3, 4($0) # byte-addressable
52
어셈블리 언어로 표현하시오 (word addressable memory/ byte addressable memory) write $t7 into memory word 11
sw $t7 11($0) # word-addressable sw $t7 44($0) # byte-addressable
53
Big-Endian Memory 란 ?
주소를 할당할 때, MSB(most significant bit) 부터 할당
54
Little-Endian memory 란 ?
주소를할 당할 때, LSB 부터 할당
55
suppose $t0 initially contains 0x23456789. After the following program is runjon a big -endian system, what value does $s0 contain? In a little-endian system? sw $t0, 0($0) lb $s0, 1($0)
``` # 0x23456789 를 메모리 0번지에 저장 # 메모리 1번지 에 있는 값을 레지스터 $s0 로 로드함 ``` 로드 되는 값은 일단 바이트 어드레서블 이니까 1번지 당, 바이트. 바이트 단위로 나누면 23|45|67|89 빅엔디언 메모리 이므로 23(0)|45(1)|67(2)|89(3) 따라서 1번지에 저장된 값은 바이트 45 이것이 32비트 공간의 $s0 에 로드 되므로 결과적으로 $s0 에 저장된 값은 : 00 00 00 45
56
즉치는 무엇이고 왜 즉치라고 부르는가?
즉치는 코드에 hard-coded 된 값이라서 메모리혹은 레지스터 액세스를 할 필요 없이 바로 쓸 수 있는 값임
57
add immediate instruction (operand 가 immediate 인 ADD) 의 기호는?
addi
58
즉치값으로 들어 올 수 있는 값은?
16비트의 2의 보수
59
즉치값으로 들어올 수 있는값의 범위는 ?
[-2^15, 2^15-1]
60
다음을 어셈블리어로 표현하시오 ``` a = a + 4; b = a - 12; ``` #$s0 = a, #s1 = b
addi $s0, $s0, 4 | addi $s1, $sa, -12
61
subtract immediate 은 필요할 까요?
필요 하지 않다. 왜냐면 immediate 값은 16비트의 2의 보수이기 때문에, 음수 표현이 가능하기 때문이다.
62
Hello World 를 출력하는 어셈블리 프로그램을 작성하세요
.text .globl main main: la $a0, str li $v0, 4 syscall li $v0, 10 syscall .data str: .asciiz "Hello World!\n"
63
자신의 이름을 출력하는 어셈블리 프로그램을 작성하세요
.text .globl main: la $a0, name li $v0, 4 syscall li $v0, 10 syscall .data name: .asciiz "Jiwon Park\n"
64
[10010000] 6c6c6548 6f57206f 21646c72 0000000a 가 나타내는 것은 Hello World! 이다. 왜 그런지, 정확히 어떤 부분이 어떤 알파벳을 나타내는 지 쓰시오
일단 주소 [10010000] 에 저장된 것은 아스키 코드이다. ( 7비트를 사용하는 알파벳 기호로 표현되는 값) 6c 6c 65 48 -> l l e H 6f 57 20 6f -> o W o 21 64 6c 72 -> ! d l r #왼쪽에서 오른쪽으로 (아랍어 같이) 아스키로 표현된 것을 볼 수 있음