home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / sys / amiga / programm / 17434 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  4.8 KB

  1. Xref: sparky comp.sys.amiga.programmer:17434 comp.sys.amiga.hardware:21634
  2. Path: sparky!uunet!cs.utexas.edu!sdd.hp.com!ux1.cso.uiuc.edu!moe.ksu.ksu.edu!crcnis1.unl.edu!cse.unl.edu!tbills
  3. From: tbills@cse.unl.edu (Trent Bills)
  4. Newsgroups: comp.sys.amiga.programmer,comp.sys.amiga.hardware
  5. Subject: Re: CISC and RISC
  6. Date: 16 Dec 1992 16:20:38 GMT
  7. Organization: University of Nebraska--Lincoln    
  8. Lines: 72
  9. Distribution: world
  10. Message-ID: <1gnl0mINNpq2@crcnis1.unl.edu>
  11. References: <amipb.04wr@amipb.gna.org> <37844@cbmvax.commodore.com> <Bz8FD1.Dxt@ns1.nodak.edu> <BzByvD.FA9@news.cs.andrews.edu>
  12. NNTP-Posting-Host: cse.unl.edu
  13.  
  14. |> Another Advantage of RISC is the abundance of Register memory.  CISC
  15. |> commonly contains few registers (The 68000 has 8 data registers and 8
  16. |> address registers) while RISC processors contain anywhere from 32 registers
  17. |> to a few hundred registers (It is not uncommon to have RISC processors that
  18. |> have 512 registers).  Since Register memory is about 10 times faster than
  19. |> main memory, most of the instructions are register to register, therefore
  20. |> increasing efficiency.
  21.  
  22. Since most microprocessor computers have either on chip or external caches,
  23. register access really isn't much if any faster than memory access.  The
  24. real speedup comes from the fact that register to register operations
  25. can be coded in a short and easy to decode instruction word (usually 32
  26. bits).
  27. It is important to note that RISC processors that have > 32 registers do
  28. not have the use of all of these registers simultaneously.  The processor
  29. only has access to a few (24-32) at a time.  A compiler can then place
  30. parameters for function calls in the last few registers.  When the
  31. function call is executed, the CPW (current window pointer) is changed
  32. so that the registers that were previously the last few are now the first
  33. few.  This parameter passing technique avoids using the stack (slow memory)
  34. and thereby drastically reduces the cost (time) of a function call.
  35.  
  36. |> There is also a significant amount of parallellism and pipelining in RISC
  37. |> chips.  As soon as an instruction is started another instruction may be
  38. |> started even before the completion of the previous instruction.  Output of
  39. |> one instructions is passed on to another Unit in the chip for further
  40. |> processing while the current unit executing the instruction fetches a new
  41. |> instruction to process.  On many RISC chips as many as 4 instructions can be
  42. |> completed in one clock cylce as a result of this.
  43.  
  44. Most RISC chips are NOT capable of completing 4 instructions in one clock
  45. cycle.  Most RISC chips use a simple 4 or 5 stage pipeline which means that
  46. one instruction is started every clock cycle and one instruction finishes
  47. every clock cycle, only the instruction that is completed in a given
  48. cycle was actually started 4 or 5 cycles before.  This results in a net
  49. throughput of 1 instruction per clock cycle.
  50.  
  51. |> >I was under the impression that CISC meant complicated instruction set
  52. |> >and RISC meant reduced instruction set. So wouldn't that mean larger
  53. |> >code size on a RISC machine compared to CISC.
  54. |> >
  55. |> >What are the advantages of CISC and RISC?
  56. |> 
  57. |> CISC I think is easier to program.  RISC is difficult as you have to worry
  58. |> about timing your instructions properly.  If you issued a memory write and
  59. |> do a read from the same location immediately after the write instruction,
  60. |> the data you may have wanted to read may not be there yet!  So you may have
  61. |> to issue the write a few steps earlier than you would normally on a CISC
  62. |> chip.
  63.  
  64. RISC is based on several observations made by looking at compiler generated
  65. code.  The first is that compiler writers have great difficulty in trying
  66. to find situations under which a complicated assembly code instruction
  67. can be used.  It has been observed that compilers for CISC machines do not
  68. typically make use of "nifty" instructions.  Second, it has been observed
  69. that compilers for CISC machines ussually only use one or two addressing
  70. modes.  Therefore, in the RISC processor, only one or two addressing modes
  71. are implemented.  These simplifications and the register to register only
  72. operations allow RISC designers to fit their instructions into a fixed
  73. size instruction word (32 or 64 bits).  The fixed size instruction word
  74. greatly reduces the complexity of the instruction decode portion of the
  75. CPU.  All of these simplifications add up to a great savings in space
  76. on the chip.  This extra space can be used for a cache, large register
  77. file, or on chip coprocessors.
  78.  
  79. Since RISC is actually based on observations of existing compiler generated
  80. CISC code, compilers have no problem generating code for RISC processors.
  81. While the pipeline in the RISC processor does introduce some restrictions
  82. on what instructions can be executed after others, compilers usually have
  83. no problems getting around these restrictions.
  84.  
  85.  - Trent Bills
  86.