sliver__

2.2 Operations of the Computer Hardware 본문

CS/컴퓨터 구조

2.2 Operations of the Computer Hardware

sliver__ 2023. 10. 19. 22:14
728x90

MIPS notation

 

=> add a, b, c : b와 c를 더해 a에 저장해라

 

그러면 a = b + c + d + e 는?

add a, b, c

add a, a, d

add a, a, e

 

한 줄에 하나의 명령어를 가질 수 있다.

주석도 한 줄에 끝나야 한다.

피 연산자는 항상 3개.

 

Design Principle 1 : Simplicity favors regulariry

MIPS 명령어들

 

Quiz 1) C language로 표현된 아래 수식을 MIPS assembly로 바꿔봐

a  = b + c

d = a - e

==>

add a, b, c

sub d, a, e

 

Quiz2) 아래 수식을 C Compiler는 어떻게 처리할까?

f = ( g + h ) - ( i + j );

add t0, g, h

add t1, i, j

sub f, t0, t1

728x90

'CS > 컴퓨터 구조' 카테고리의 다른 글

2.7 Instructions for Making decision  (0) 2023.10.20
2.6 Logical Operations  (0) 2023.10.20
2.5 Representing Instruction in the Computer  (1) 2023.10.20
2.4 Signed and Unsigned Numbers  (1) 2023.10.19
2.3 Operands of the Computer Hardware  (1) 2023.10.19
Comments