Computer Architecture 연습문제 (Mips cpu)
- 최초 등록일
- 2006.11.09
- 최종 저작일
- 2006.01
- 5페이지/ 한컴오피스
- 가격 1,000원
소개글
컴퓨터 구조 연습문제 입니다.
몇개 안되니 필요하신분만 받아가시기 바랍니다~
목차
1.48 If a computer issue 30 network request per second and each request is on average 64KB, will a 100 Mbit Ethernet link be sufficient?
2.4 Why doesn`t MIPS have a subtract immediate instruction ?
2.29 Add comments to the following MIPS code and describe in one sentence what it computes. Assume that $a0 and $a1 are used for the input and both initially contain the integers a and b, respectively. Assume that $v0 is used for the output.
3.4 what decimal number does this two`s complement binary number represent..
6.22
본문내용
2.4 Why doesn`t MIPS have a subtract immediate instruction ?
☞ 1. Negative constants appear much less frequntly in C and Java, so they are not the common case and do not merit special support. 2. since the immediate field holds both negative and positive constants, add immediate with a negative number is equivalent to subtract immediate whit a positive number, so subtract immediate is superfluous.
음의 상수는 C 나 Java에서 자주 나타나지 않으므로 특별하게 지원할 장점이 없다.
그래서 immediate field 는 negative 와 positive 를 겸하게 된다.
음수의 immediate 덧셈은 (즉 2의 보수의 덧셈)은 양수의 subtract immediate 와 등가이기 때문에 subtract immediate는 불필요하다.
2.29 Add comments to the following MIPS code and describe in one sentence what it computes. Assume that $a0 and $a1 are used for the input and both initially contain the integers a and b, respectively. Assume that $v0 is used for the output.
add $t0, $zero, $zero // $t0를 0으로 초기화
loop : beq $a1, $zero, finish // $a1 == 0 이면 finish 로 분기
add $t0, $t0, $a0 // $a10 일 경우 $t0= $t0 + $a0
sub $a1, $a1, 1 // $a10 일 경우 $a1= $a1 - 1
j loop // $a10 일 경우 loop 으로 분기
finish: addi $t0, $t0, 100 // $a1==0 일 경우 분기해서 $t0=$t0 + 100 수행
add $v0, $t0, $zero // $a1==0 일 경우 $v0=$t0+$zero
참고 자료
없음