CS101 Assignment 1 Solution spring 2021 – The Only 100% correct Solution. Data Manipulation: CPU Architecture Philosophies to apply the stored program concept, CPUs are designed to recognize instructions encoded as bit patterns.
This collection of instructions along with the encoding system is called the machine language. An instruction expressed in this language is called a machine level instruction or, more commonly, a machine instruction. The list of machine instructions that a typical CPU must be able to decode and execute is quite short. In fact, once a machine can perform certain elementary but well-chosen tasks, adding more features does not increase the machine’s theoretical capabilities. In other words, beyond a certain point, additional features may increase such things as convenience but add nothing to the machine’s fundamental capabilities.
Introduction to Computing (CS101) Assignment # 01 Spring 2021 | Total marks = 20 24 May 2021 |
Given is a snapshot of memory addresses E2 to F4 and CPU registers 0 to F. All bit patterns in the memory cells are represented in hexadecimal notation.
E2 – 1 5 F2 – F2
E4 – 1 2 F4 –F4
E6 – 5 1 15 – 08
E8 – 3 1 F3 -> 08
EA – 5 0 03 -> 03
EC – B 1 F0 -> No jump
EE – 9 1 21 -> FC
EF – C 0 00 — Halt
……. ONE INSTUCNTION..
1 -> OPCODE-
5 -> REGISTAR NO
F2 -> VALUE OR REGISTER
1. Determine the contents of register 1 when the machine halts.
FC
2. Write down the bit pattern (in hexadecimal) at memory address F3 when the Halt
instruction is executed.
08
3. How many times the machine instruction at address EE is executed before the machine
halts.
06
4. Determine the contents of register 0 after the instruction at address EC is executed.
03
5. Determine the contents of register 2 when the instruction at address F0 is executed
F4
Question No 2
01001001 01000001 01001101 01011100
73 65
128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | Decimal |
0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 64+1 = 65 |
0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 64+8+1=73 |