Cao Assignment 2 Answers New
Cao Assignment 2 Answers New
Fetch cycle: In this cycle, the processor reads the instruction that is to be
executed from the memory.
Execute cycle: In this cycle, the processor interprets the opcode of the
fetched instruction and performs the operations accordingly.
Instructions vary in length. They can be a few bits long or many bytes. A
very long instruction word (VLIW) is a processing architecture where the
instructions are processed in parallel. VLIW is mostly used in high-
performance, embedded applications. Reduced instruction set computer,
or RISC, microprocessors are designed to perform a small number of
computer instruction types, often of fixed lengths.
Operands are definite elements of computer instruction that show what information
is to be operated on. The most important general categories of data are
1. Addresses
2. Numbers
3. Characters
4. Logical data
Addresses
Addresses are nothing but a form of data. Here some calculations must be performed
on the operand reference in an instruction, which is to determine the physical address
of an instruction.
Numbers
All machine languages include numeric data types. Even in non-numeric data
processing, numbers are needed to act as counters, field widths, etc. An important
difference between numbers used in ordinary mathematics and numbers stored in a
computer is that the latter is limited. Thus, the programmer is faced with
understanding the consequences of rounding, overflow and underflow.
Characters
A common form of data is text or character strings. While textual data are most
convenient for humans. Here are the two common standards, such as:
Logical data
Normally, each word or other addressable unit (byte, half-word, and so on) is treated
as a single unit of data. Sometimes, it is useful to consider an n-bit unit consisting of
1-bit items of data, each item having the value 0 or 1. When data are viewed this way,
they are considered to be logical data.
Types of operations:
There are two common types of operations: unary and binary. Unary operations involve only one
value, such as negation and trigonometric functions.[3] Binary operations, on the other hand, take
two values, and include addition, subtraction, multiplication, division, and exponentiation.[4]
Operations can involve mathematical objects other than numbers. The logical
values true and false can be combined using logic operations, such
as and, or, and not. Vectors can be added and subtracted. [5] Rotations can be combined using
the function composition operation, performing the first rotation and then the second. Operations
on sets include the binary operations union and intersection and the unary operation
of complementation.[6][7][8] Operations on functions include composition and convolution.[9][10]
A state machine is any device storing the status of something at a given time.
The status changes based on inputs, providing the resulting output for the
implemented changes. A finite state machine has finite internal memory. Input
symbols are read in a sequence producing an output feature in the form of a
user interface.
State machines are represented using state diagrams. The output of a state
machine is a function of the input and the current state. State machines play a
significant role in areas such as electrical engineering, linguistics, computer
science, philosophy, biology, mathematics, and logic. They are best used in the
modeling of application behavior, software engineering, design of hardware
digital systems, network protocols, compilers, and the study of computation and
languages
The two different groups of state machines are acceptors and transducers.
Acceptors produce a binary output, based on whether the input is accepted or
rejected by the machine.
Process States
Process states are the states in which the process is currently residing. There are basically five
states of processes −
New − The process is about to be created in this state but not yet created. It is
the program which is present in secondary memory that will be picked up by OS
to create the process.
Ready − The process enters the ready state after the creation of a process that
means the process is loaded into the main memory.
Running − The process is chosen by the CPU for instructions and the executions
within the process and they are executed by any one of the available CPU cores.
Waiting − Whenever the process requests access to I/O or needs input from the
user or needs access to a critical region it enters the blocked or wait state.
Terminated − Process is killed as well as PCB (Process Control Box) is deleted.
RISC CISC
1. RISC stands for Reduced Instruction1. CISC stands for Complex Instruction
Set Computer. Set Computer.
2. CSIC processor has complex
2. RISC processors have simple instructions that take up multiple clocks
instructions taking about one clock for execution. The average clock cycle
cycle. The average clock cycle per per instruction (CPI) is in the range of 2
instruction (CPI) is 1.5 and 15.
3. Performance is optimized with more 3. Performance is optimized with more
focus on software focus on hardware.
4. It has no memory unit and uses
separate hardware to implement 4. It has a memory unit to implement
instructions.. complex instructions.
5. It has a hard-wired unit of
programming. 5. It has a microprogramming unit.
6. The instruction set is reduced i.e. it
has only a few instructions in the 6. The instruction set has a variety of
instruction set. Many of these different instructions that can be used
instructions are very primitive. for complex operations.
7. CISC has many different addressing
7. The instruction set has a variety of modes and can thus be used to
different instructions that can be used represent higher-level programming
for complex operations. language statements more efficiently.
8. Complex addressing modes are 8. CISC already supports complex
synthesized using the software. addressing modes
9. Multiple register sets are present 9. Only has a single register set
10. They are normally not pipelined or
10. RISC processors are highly pipelined less pipelined
11. The complexity of RISC lies with the 11. The complexity lies in the
compiler that executes the program microprogram
12. Execution time is very less 12. Execution time is very high
13. Code expansion can be a problem 13. Code expansion is not a problem
14. The decoding of instructions is
simple. 14. Decoding of instructions is complex
15. It does not require external memory 15. It requires external memory for
for calculations calculations
16. The most common RISC
microprocessors are Alpha, ARC, ARM, 16. Examples of CISC processors are the
AVR, MIPS, PA-RISC, PIC, Power System/360, VAX, PDP-11, Motorola
Architecture, and SPARC. 68000 family, AMD, and Intel x86 CPUs.
17. RISC architecture is used in high-end
applications such as video processing, 17. CISC architecture is used in low-end
telecommunications, and image applications such as security systems,
processing. home automation, etc.