University of The People CS1104: Computer Systems Instructor: Raval Dipakkumar May 11, 2022
University of The People CS1104: Computer Systems Instructor: Raval Dipakkumar May 11, 2022
University of The People CS1104: Computer Systems Instructor: Raval Dipakkumar May 11, 2022
The Hack architecture is a 16-bit von Neumann architecture that is made of:
The Hack architecture is unique in the way that it uses a single-cycle fetch-execute logic. While
most general-purpose computers use a two-cycle logic, the Hack computer executes the current
instruction and reads (fetches) the next instruction in a single, two-part clock cycle.
This can be done by using two instructions, an address instruction (A-instruction) and a compute
instruction (C-instruction). Each type of instruction can be represented in the following symbolic
and binary syntax.
A-instruction
C-instruction
In the binary syntax, if MSB (Most Significant Bit) is 0, it represents A-instruction and if MSB is 1,
it represents C-instruction.
For example, for the A-instruction, we can use the following syntax.
Symbolic syntax
@25 //represents the value that is loaded into the A register
Binary syntax
0000000000011001 //MSB is 0, which represents A-instruction followed by the value 25
If we want to set RAM[300] to the value of the D register minus 1, the symbolic representation
will be as followed:
@250 // selecting the memory, data memory=250
M=D-1 // RAM[250] = D -1
Discuss the difference between RISC and CISC architecture. What are the advantages and
disadvantages of each architecture?
RISC (Reduced Instruction Set Computer Processor) and CISC (Complex Instruction Set
Computer) are types of microprocessors. It performs the core functions of a computer CPU.
As the names indicate RISC is built to minimize the instruction and CISC has a more complex
decoding of instructions.
Some of the differences between RISC and CISC are (GeeksforGeeks, 2022):
1. RISC uses a limited number of instructions and CISC uses a larger number of
instructions.
2. RISC execution time is shorter while CISC execution time is longer.
3. RISC's instructions are generally executed in one clock cycle while CISC's instructions
may take longer than a single clock cycle to execute.
4. RISC uses the pipelining technique to execute multiple parts of instructions while CISC is
not pipelined or less pipelined.
5. RISC uses multiple registers while CISC uses a single register set.
6. RISC has fixed format instruction while CISC's instruction length could be variable.
7. RISC does not support an array while CISC supports an array.
Advantages of RISC
Due to the small number of the instruction set used, the RISC's performance is better.
RISC is simpler than CISC due to its simple design and the ability to execute in one clock
cycle.
Since the execution time is minimized, it can increase the speed of the overall operations
while maximizing efficiency.
The computer has to repeatedly perform simple operations to execute a larger program
having a large number of processing operations.
The performance of RISC processors depends on the compiler or the programmer. The
following instructions might rely on the previous instruction to finish their execution.
Advantages of CISC
References
GeeksforGeeks. (2022, January 13). Difference between RISC and CISC processor | Set
2. https://www.geeksforgeeks.org/difference-between-risc-and-cisc-processor-set-2/
Javatpoint. (n.d.). Difference Between RISC and CISC - javatpoint.
Javatpoint. https://www.javatpoint.com/risc-vs-cisc
University of Washington. (2020). Hack Assembly &
Reflection. https://courses.cs.washington.edu/courses/cse390b/20sp/lectures/
CSE390b_Week4_Lecture8.pdf