Sunday, 9 February 2014

Computer System Architecture Low level programming / CPU NDCSA3

P7
Polling
Polling is when a CPU checks the printer to see if it’s ready to receive another printing it does this by using ‘’busy flag’’ if the ‘’busy flag’’ is ON then the printer is not ready to receive another print. Polling it’s a really good thing so you don’t overload the printer and confuse it. When the busy flag is OFF the computer will send the data to the printer the ‘’busy flag’’ will show the digit 1 to the CPU this makes the computer aware that its ready to receive data however when the ‘’busy flag’’ shows the 0 it will make the CPU ready to receive data for printing and it’s not busy. The disadvantage of using this system is that the CPU is keep checking to see if the printer is ready and doing all this it wastes a lot of resources trying to find information out.
Polling is the main priority in the CPU this means is the first task that the CPU will attempt if the printer is in use by another computer and the CPU is still checking if the printer is in use may use a lot of valuable resources and slow down the computer.
CPU
PRINTER
Tries to send information busy flag is on
CPU
PRINTER
The CPU will keep sending the data until the busy flag is OFF
Computer sends data but the ‘’busy flag’’ is OFF so it’s able to print the data

 







The CPU will keep trying to check if the printer is ready and because as a priority its wasting a lot resources until the printer is no longer busy. They are is another way the computer to find out whether the CPU is ready to print and do not waste a lot of resources this is called interrupt this works on how the CPU send the data to the printer buffer and if the buffer if full the CPU remove data will poke the CPU interrupt this is the form of acknowledging the computer that is ready to print this saves a lot of system resources because the computer is no longer checking all the time to see whether the ‘’busy flag’’ is ON and is no longer a high priority.



CPU
PRINTER

Sends data to the printer
CPU
PRINTER
Buffer is empty printer interrupts CPU
CPU
PRINTER

Printer buffer is FULL
 










The best one to use would be interrupts as the CPU will be able to focus on other tasks rather than wasting resources to find out whether the printer is in use or not.
P8
CISC:
Pronounced sisk, and stands for complex instruction set computer. Most personal computers use a CISC architecture, in which the CPU supports as many as two hundred instructions. The traditional architecture of a computer which uses microcode to execute instructions. Instructions may be variable in length and use all addressing modes, requiring complex circuitry to decode them.
RISC:
It’s a type of microprocessor that recognizes a relative limited number of instructions. One advantage is that they can execute their instructions very fast because the instructions are so simple. Another important advantage is that the RISC chips requires transistors which makes them cheaper to design and produce.


karbosguide.com
The RISC machine executes instructions faster because it does not have to go through a microcode conversion layer. The RISC compiler generates more instructions than the CISC compiler for the same processing.
 








Comparison between RISC and CISC
CISC
RISC
Emphasis on hardware
Emphasis on software
Includes multi-clock complex instructions
Single-clock, reduced instruction only

Memory-to-memory:
"LOAD" and "STORE" incorporated in
Instructions
Register to register:
"LOAD" and "STORE" are
independent instructions
Small code sizes, high cycles per second
Low cycles per second, large code
Sizes
Transistors used for storing complex
http://www-cs-faculty.stanford.edu/~eroberts/courses/soco/projects/risc/risccisc/
Instructions
Spends more transistors on memory registers
CISC (complex instruction set computer) and RISC (reduces instruction set computer) CISC is a type of processes within the CPU it uses complex instructions and it takes time. RISC is a type of processes which uses small types of instructions in order to get the job done the fastest way
The advantages of using RISC would be that it will be able to work on small programs faster you should mainly use RISC for non-important programs this is because it gets the job done really fast  and is a lot more effective to smaller programs this is because it only uses simple processes if it was working on a larger program then it wouldn’t be as accurate for the large programs because it works so fast it might miss parts. It has faster processing’s so its able to do tasks faster e.g. less important tasks.  Simpler hardware. Because the instruction set of a RISC processor is so simple, it uses up much less chip space, extra functions, such as memory management units or floating point arithmetic units, can also be placed on the same chip. The disadvantages of RISC is that it doesn’t work with larger programs right due to the simple instructions it uses and how fast it works.
Advantages of CISC It’s more effective for larger programs because of its complex instructions it doesn’t work well with smaller programs because they don’t need so many complex instructions, and CISC may be a lot slower to process it than RISC.
More energy effective because it works with the code instead of just doing loads of simple ones.
The disadvantage of CISC that it does instructions a lot slower because of its complex instructions.
So that as many instructions as possible could be stored in memory could be of almost any length this means that different instructions will take different amounts of clock time to execute, slowing down the overall performance of the machine









P9
20
201
20
200
Memory
NA
N/A
120
IR
ACC
PC
CPU
Its starts at 120











                                                                                                                          












20
201
20
200
Memory
Get 200
20
121
IR
ACC
PC
CPU
The first instruction goes into the instruction register and the IR is told to get the memory and then execute the instruction then the executed instruction is stored into the ACC











The second instruction is executed and stores a copy of the contents in the accumulator and stores it in to the memory location 201.
20
201
20
200
Memory
Store 200
20
122
IR
ACC
PC
CPU
 












20
201
20
200
Memory
STOP
20
123
IR
ACC
PC
CPU
The third instruction is fetched from the IR and then executed by the PC which stops the program













http://yoram.info
Memory Address Register (MAR)
Memory Data Register (MDR)
Instruction Register (IR)
Program Counter (PC)
Accumulator

Each register is designed for a special purpose and the volume of each varies. This special purpose could be to contain the address of instructions or data being accessed in main memory its called Memory Address Register (MAR). The register, which contains the actual instruction or data, fetched or to be stored in the main memory, is called the Memory Data Register (MDR). The Instruction Register (IR) holds the current instruction to be executed. A register that holds the address of the next instruction to be executed and when this instruction is fetched by (IR) it increases automatically to point (hold) the next address of the instruction to be executed and is referred to as the Program Counter (PC). The Accumulator collects intermediate results from the ALU in order to store and manipulate these intermediate results to obtain the final desired result.

No comments:

Post a Comment