edited by
2,155 views
2 votes
2 votes
Show below are sements of a code run on a CISC and RISC archy separately

CISC                                                           RISC

MOV AX,05                                                  MOV AX,00

MOV BX,06                                                  MOV BX,05

MUL AX,BX                                                  MOV CX,06

                                                                  start:ADD AX,BX    loop

                                                                   loop start; loop till CX=0

 

If the MUL instruction takes 40 clock cycles,Which of the following statement is true?

(a) The CISC code will run faster by a factor of 1.8

(b) The RISC code will run faster by a factor of 2.8

(c) The CISC code runs slower by a factor of 0.025

(d) The RISC code will run faster by a factor of 40
edited by

2 Answers

1 votes
1 votes
CISC will take 42 cycles

RISC will take 15 cycles( 3 for move statements and 12 for loop)

so speed up=42/15

                  =2.8

So RISC code will run faster by factor of 2.8
0 votes
0 votes

Some points to consider:

  • RISC architecture has Cycles Per Instructions (CPI) = 1.
  • The value of CX would keep on decrementing till CX = 0.
  • Each ADD word has two instructions- performing ALU operation between operands in AX & BX and then storing the result in register AX. Hence, 2 cycles per ADD instruction is to be taken. MOV would take 1 cycle.

- Now in RISC architecture, the value in register AX would update according to the following table:

AX

CX

05 05
10 04
15 03
20 02
25 01
30 00

 

Total number of cycles for RISC system = ADD looping + MOV commands = (6 x 2) + 3 = 15.

- In CISC architecture,

  • MUL takes 40 cycles (given)
  • Each MOV operation takes 1 cycle.

Total number of cycles for CISC system = MUL operation + MOV commands = 40 + 2 = 42

Hence, speedup = 42/15 = 2.8 (Option B)

Related questions