Fall 2024: Introduction to Computer Systems - Assignment 2
VerifiedAdded on 2025/04/29
|13
|1153
|285
AI Summary
Desklib provides past papers and solved assignments for students. This solved assignment covers number systems, interrupts, and bus architectures.

Contents
Assessment #2.......................................................................................................................................2
Assignment #1:......................................................................................................................................2
Question #1:..........................................................................................................................................2
(a)......................................................................................................................................................2
(b)......................................................................................................................................................3
(i)...................................................................................................................................................3
(ii)..................................................................................................................................................4
(iii)..................................................................................................................................................5
(iv)..................................................................................................................................................5
(c).......................................................................................................................................................6
(i)...................................................................................................................................................6
(ii)..................................................................................................................................................6
(iii)..................................................................................................................................................7
Question #2:..........................................................................................................................................8
(a)......................................................................................................................................................8
(b)....................................................................................................................................................10
Question #3:........................................................................................................................................10
(a)....................................................................................................................................................10
(b)....................................................................................................................................................11
References:..........................................................................................................................................12
1
Assessment #2.......................................................................................................................................2
Assignment #1:......................................................................................................................................2
Question #1:..........................................................................................................................................2
(a)......................................................................................................................................................2
(b)......................................................................................................................................................3
(i)...................................................................................................................................................3
(ii)..................................................................................................................................................4
(iii)..................................................................................................................................................5
(iv)..................................................................................................................................................5
(c).......................................................................................................................................................6
(i)...................................................................................................................................................6
(ii)..................................................................................................................................................6
(iii)..................................................................................................................................................7
Question #2:..........................................................................................................................................8
(a)......................................................................................................................................................8
(b)....................................................................................................................................................10
Question #3:........................................................................................................................................10
(a)....................................................................................................................................................10
(b)....................................................................................................................................................11
References:..........................................................................................................................................12
1
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Assessment #2
Assignment #1:
Question #1:
(a)
(152)b = 0x6A
Sol. 6 Ais a Hexadecimal number
In Decimal, it will be
(6 A)1 6=6∗161 +10∗160
(6 A)1 6=(106)10
(152)b=(106)10
Base ‘b’ will be,
1∗x2 +5∗x1 +2∗x0=106
x2+5 x−104=0
Quadratic Formula says that,
x=−b ± √ b2−4 ac
2 a
Values of
a = 1
b = 5
c = -104
Replacing values of a, b & c into above equation,
x=−5 ± √ 52−4 (1)(−104)
2∗1
x=−5 ± √ 25+ 416
2
x=−5 ±21
2
2
Assignment #1:
Question #1:
(a)
(152)b = 0x6A
Sol. 6 Ais a Hexadecimal number
In Decimal, it will be
(6 A)1 6=6∗161 +10∗160
(6 A)1 6=(106)10
(152)b=(106)10
Base ‘b’ will be,
1∗x2 +5∗x1 +2∗x0=106
x2+5 x−104=0
Quadratic Formula says that,
x=−b ± √ b2−4 ac
2 a
Values of
a = 1
b = 5
c = -104
Replacing values of a, b & c into above equation,
x=−5 ± √ 52−4 (1)(−104)
2∗1
x=−5 ± √ 25+ 416
2
x=−5 ±21
2
2

two values of x will be carried out :
For Plus sign
x=−5+21
2
x=−16
2
x=−8
For minus sign
x=−5−21
2
x=−26
2
x=−13
Since x or base is positive, signs are neglected
base 8 calculations
1∗82+ 5∗81+ 2∗80 =106
64+40+2=106
L . H . S .=R . H . S .
Hence , base of (152)b =0x6A will be 8
Therefore, (152)8=0 x 6 A
(b)
(i)
0xBAD into a 3-base representation
First of all the Hexa-decimal number should be converted intoa Decimal number
¿ 11∗162+ 10∗161 +13∗160
¿ 11∗256 +160+13
3
For Plus sign
x=−5+21
2
x=−16
2
x=−8
For minus sign
x=−5−21
2
x=−26
2
x=−13
Since x or base is positive, signs are neglected
base 8 calculations
1∗82+ 5∗81+ 2∗80 =106
64+40+2=106
L . H . S .=R . H . S .
Hence , base of (152)b =0x6A will be 8
Therefore, (152)8=0 x 6 A
(b)
(i)
0xBAD into a 3-base representation
First of all the Hexa-decimal number should be converted intoa Decimal number
¿ 11∗162+ 10∗161 +13∗160
¿ 11∗256 +160+13
3
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

( BAD)1 6=(2989)10
After this, base-10 number 2989 will be converted into base-3 number by division.
Diviso
r
Dividen
d
Rest
3 2989
3 996 1
3 332 0
3 110 2
3 36 2
3 12 0
3 4 0
1 1
The arrow shows the sequence of decimal to base-3 conversion.
Therefore,
Ans : ( BAD )10= ( 2989 )10= ( 11002201 )3
(ii)
(321)7 into a base-2 representation
First of all the base-7 will be converted into base-10 or a decimal number
(321)7=3∗72 +2∗71+1∗70
(321)7=( 162)10
After this, base-10 number 162 will be converted into base-7 number by division.
Diviso
r
Dividend Rest
2 162
2 81 0
2 40 1
2 20 0
2 10 0
4
After this, base-10 number 2989 will be converted into base-3 number by division.
Diviso
r
Dividen
d
Rest
3 2989
3 996 1
3 332 0
3 110 2
3 36 2
3 12 0
3 4 0
1 1
The arrow shows the sequence of decimal to base-3 conversion.
Therefore,
Ans : ( BAD )10= ( 2989 )10= ( 11002201 )3
(ii)
(321)7 into a base-2 representation
First of all the base-7 will be converted into base-10 or a decimal number
(321)7=3∗72 +2∗71+1∗70
(321)7=( 162)10
After this, base-10 number 162 will be converted into base-7 number by division.
Diviso
r
Dividend Rest
2 162
2 81 0
2 40 1
2 20 0
2 10 0
4
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

2 5 0
2 2 1
2 1 0
The arrow shows the sequence of decimal to base-2 conversion.
Hence,
( 162 ) 10= ( 10100010 ) 2
¿ , ( 321 )7 ∈binary will be (10100010 )2
(iii)
(123)5 into an octal representation
First of all the base-5 will be converted into base-10 or a decimal number
(321)7=1∗52+2∗51 +3∗50
(321)7=( 38)10
After this, base-10 number 38 will be converted into base-8 number by division.
Diviso
r
Dividend Rest
8 38
4 6
The arrow shows the sequence of decimal to base-2 conversion.
Consequently,
( 38 )10= ( 46 )8
And the answer will be,
( 123 )5= ( 46 )8
(iv)
(21.21)8 into decimal number representation
5
2 2 1
2 1 0
The arrow shows the sequence of decimal to base-2 conversion.
Hence,
( 162 ) 10= ( 10100010 ) 2
¿ , ( 321 )7 ∈binary will be (10100010 )2
(iii)
(123)5 into an octal representation
First of all the base-5 will be converted into base-10 or a decimal number
(321)7=1∗52+2∗51 +3∗50
(321)7=( 38)10
After this, base-10 number 38 will be converted into base-8 number by division.
Diviso
r
Dividend Rest
8 38
4 6
The arrow shows the sequence of decimal to base-2 conversion.
Consequently,
( 38 )10= ( 46 )8
And the answer will be,
( 123 )5= ( 46 )8
(iv)
(21.21)8 into decimal number representation
5

Octal number 21.21 also has a fraction part
For that reason, it will be concluded by the following procedure:
(21.21)8=2∗81 +1∗80+2∗8−1+1∗8−2
(21.21)8=16+1+0.25+0.015
Ans :(21.21)8=17.265
(c)
Lowest and Highest bit values for 3-bit computer system will be
Negative or Lowest Bit = 0
Positive or Highest Bit = 111
(i)
1's complement
1’s complement for negative number
0 ↔ 1
1’s complement for positive number
111 ↔000
(ii)
Two's complement
For 2’s complement, first of all, 1’s complement should be concluded
1’s complement for negative number
0 ↔ 1
6
For that reason, it will be concluded by the following procedure:
(21.21)8=2∗81 +1∗80+2∗8−1+1∗8−2
(21.21)8=16+1+0.25+0.015
Ans :(21.21)8=17.265
(c)
Lowest and Highest bit values for 3-bit computer system will be
Negative or Lowest Bit = 0
Positive or Highest Bit = 111
(i)
1's complement
1’s complement for negative number
0 ↔ 1
1’s complement for positive number
111 ↔000
(ii)
Two's complement
For 2’s complement, first of all, 1’s complement should be concluded
1’s complement for negative number
0 ↔ 1
6
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

1’s complement for positive number
111 ↔000
2’s complement for negative number
1
+1
0
2’s complement for positive number
000
+1
001
(iii)
Signed Magnitude
For negative number
Here, 0 = positive
1 = negative
Sign-magnitude
For the negative or lowest value ‘0’
= (+)
For the positive or highest value ‘111’
The very first bit shows sign which is here negative (-)
Rest is for magnitude,
¿ 1∗21 +1∗20
7
111 ↔000
2’s complement for negative number
1
+1
0
2’s complement for positive number
000
+1
001
(iii)
Signed Magnitude
For negative number
Here, 0 = positive
1 = negative
Sign-magnitude
For the negative or lowest value ‘0’
= (+)
For the positive or highest value ‘111’
The very first bit shows sign which is here negative (-)
Rest is for magnitude,
¿ 1∗21 +1∗20
7
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

¿ 2+1
So, sign magnitude:
¿−3
8
So, sign magnitude:
¿−3
8

Question #2:
(a)
Main program:
ORG 000
INPUT USER /acquire number input
SUBT TWO /minus 2 from result
PRINT, STORE M /storing AC in M when processing of M is done
CLEAR
ADD S1 /Addition of AC and S1
ADD S2 /Addition of AC and S2
STORE TOTAL /result of addition of S1 and S2
/now S1 = S2
LOAD S2 /implant S2 in AC
STORE S1 /value storing in S1
LOAD TOTAL /value generate in AC
STORE S2 /N2 will be in AC
LOAD M /M register load
SUBT ONE /minus 1 from M
SKIPCOND 000 / AC<0, avoid cond 000
JUMP PRINT /start Loop & print
LOAD TOTAL /total value in AC
OUTPUT /display output
HALT /pause recent process progression
/Initialization of progression
USER, DEC 0
ONE, DEC 1
TWO, DEC 2
9
(a)
Main program:
ORG 000
INPUT USER /acquire number input
SUBT TWO /minus 2 from result
PRINT, STORE M /storing AC in M when processing of M is done
CLEAR
ADD S1 /Addition of AC and S1
ADD S2 /Addition of AC and S2
STORE TOTAL /result of addition of S1 and S2
/now S1 = S2
LOAD S2 /implant S2 in AC
STORE S1 /value storing in S1
LOAD TOTAL /value generate in AC
STORE S2 /N2 will be in AC
LOAD M /M register load
SUBT ONE /minus 1 from M
SKIPCOND 000 / AC<0, avoid cond 000
JUMP PRINT /start Loop & print
LOAD TOTAL /total value in AC
OUTPUT /display output
HALT /pause recent process progression
/Initialization of progression
USER, DEC 0
ONE, DEC 1
TWO, DEC 2
9
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

M, DEC 0
S1, DEC 0
S2, DEC 1
TOTAL, DEC 0
Input values when process the main program in Marie Simulator are: 7, 15 and 20
Output = 13 when input = 7
Output = 610 when input = 15
10
S1, DEC 0
S2, DEC 1
TOTAL, DEC 0
Input values when process the main program in Marie Simulator are: 7, 15 and 20
Output = 13 when input = 7
Output = 610 when input = 15
10
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Output = 6765 when input = 20
(b)
The final value for the Marie simulator is: 2147483647
After this value, there will be an incorrect output.
Question #3:
(a)
Basically interrupts are those signals or function that sends the central processing unit of the
system on halt for a while. In another word, interrupts are designed by the operating system to
stop one currently progressing process and start another process at that time which makes the
CPU think about the decision taken by the operating system and the system goes on a halt.
For example, when an input device like a USB keyboard is attached to the system, it stops
processing other processes and process keyboard to attach it with the system.
Basically, Interrupts are of two types, Software Interrupt and Hardware Interrupt
Interrupt Handling Approach
Following are the approaches that can be used to handle the Interrupts.
1. Define Priority: Priorities declaring is the most commonly used approach to interrupt
handling. Basically, CPU receives too many interrupt sometimes by a program, sometimes by
I/O device and sometimes by any software but defining the priority of which interrupt should
be engaged first can save time and also handles the interrupt in a quite good manner.
11
(b)
The final value for the Marie simulator is: 2147483647
After this value, there will be an incorrect output.
Question #3:
(a)
Basically interrupts are those signals or function that sends the central processing unit of the
system on halt for a while. In another word, interrupts are designed by the operating system to
stop one currently progressing process and start another process at that time which makes the
CPU think about the decision taken by the operating system and the system goes on a halt.
For example, when an input device like a USB keyboard is attached to the system, it stops
processing other processes and process keyboard to attach it with the system.
Basically, Interrupts are of two types, Software Interrupt and Hardware Interrupt
Interrupt Handling Approach
Following are the approaches that can be used to handle the Interrupts.
1. Define Priority: Priorities declaring is the most commonly used approach to interrupt
handling. Basically, CPU receives too many interrupt sometimes by a program, sometimes by
I/O device and sometimes by any software but defining the priority of which interrupt should
be engaged first can save time and also handles the interrupt in a quite good manner.
11

2. Interrupt Handler: Use of interrupt handler is also a good approach. Every software which is
installed in the system keeps their own interrupt handler and device driver also include this
function. Like in Linux, C function is used as an interrupt handler. When one interrupt is
progressing, the others are inactivated and after the completion of that interrupt, other are
engaged.
(b)
Following are the benefits of using multiple bus architecture over single bus architecture.
Speed and Efficiency:
In single bus architecture, there is only one bus for the data transaction, connection, program
execution and any process that consumes too much time if 4-5 operations are processed at the same
time. While multiple bus architecture has multiple buses to handle this scenario.
OS Compatible:
Multiple buses have more drivers than single buses that make them more compatible while adding
new devices or installing a new operating system.
Core advantage:
Single Bus Architecture has operated on a single core which isn’t able to process all the memory data,
network system, I/O device request and make it very congested while using Multiple Bus Architecture
can handle this problem easily as it has multiple cores to progress any request.
12
installed in the system keeps their own interrupt handler and device driver also include this
function. Like in Linux, C function is used as an interrupt handler. When one interrupt is
progressing, the others are inactivated and after the completion of that interrupt, other are
engaged.
(b)
Following are the benefits of using multiple bus architecture over single bus architecture.
Speed and Efficiency:
In single bus architecture, there is only one bus for the data transaction, connection, program
execution and any process that consumes too much time if 4-5 operations are processed at the same
time. While multiple bus architecture has multiple buses to handle this scenario.
OS Compatible:
Multiple buses have more drivers than single buses that make them more compatible while adding
new devices or installing a new operating system.
Core advantage:
Single Bus Architecture has operated on a single core which isn’t able to process all the memory data,
network system, I/O device request and make it very congested while using Multiple Bus Architecture
can handle this problem easily as it has multiple cores to progress any request.
12
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 13
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.