Exam Questions: Total 50 Marks

1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Exam Questions: Total 50 Marks
Question 1 (6 marks):
a) [3 marks]
Write a 6800 program that finds the quotient of two bytes stored in variables x and y. The
output is stored into a variable called quotient. For example, if x is 910 and y is 410, then after
the program executes, quotient will be equal to 210. This is because 410 divides into 910 at
least twice. Do not compute the remainder.
1 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
b) [3 marks]
Write a 6800 program that sums all of the bits in a byte. The byte is stored in a variable called
n and the sum is stored into the variable s. For example, if n is equal to 0xFE (or binary
11111110), then after the program executes, s will be equal to 7. This is because the sum of
all of the bits in 0xFE is 7.
2 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Question 2 (6 marks):
a) [2 marks]
How many hosts are there per subnet for the network 196.237.56.0 if the subnet mask is
255.255.255.224?
b) [2 marks]
Write down the IP address for a machine on the network 124.0.0.0 using subnet mask
255.255.128.0 so that it is on subnet ID 33 and has a host ID of 18.
c) [2 marks]
Given the IP address 215.193.68.134 and the subnet mask 255.255.255.192, write down the
subnet ID.
3 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Question 3 (4 marks):
Match the following OSI layers with its function in the table by writing the name of the
corresponding OSI layer in the table:
Transport
Physical
Data Link
Session
OSI Layer
Function
Establishes, manages and
terminates connections
Uses the protocols TCP and
UDP
Enables data to be transmitted
over a medium like fiber or
twisted pair wire
Delivers a frame to an
adjacent node
4 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Question 4 (4 marks):
a) [2 marks]
Consider the following digital logic circuit:
What is the output, F, of this digital circuit if:
A
=0
B
=1
F
=
b) [2 marks]
Describe the difference between a Selector and a Decoder.
5 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Question 5 (12 marks):
a) [2 marks]
Suppose that 0xE2F9 was the original message that was sent, but instead there were some
errors and 0xE2C9 was the message that was received. Write down the Hamming Distance
between the two words.
b) [2 marks]
Use the Hamming algorithm to correct the codeword 5243 (base 8) using even parity.
c) [2 marks]
Create an 8 bit hamming codeword for the value 0xD using even parity. Show your answer in
hexadecimal.
6 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
d) [2 marks]
Use the Longitudinal Redundancy Check (LRC) method and odd parity to detect and correct
any errors in the message 0xF7C4774CFF. The last byte, 0xFF, is the Block Check Character
(BCC). Write down the corrected message in hexadecimal.
e) [2 marks]
Use the Cyclic Redundancy Check method to encode the data 0x12F9 using the 4 bit
polynomial 0xB and write down the Frame Check Sequence (FCS) in hexadecimal.
f) [2 marks]
Using the Checksum method, encode the ASCII characters ABC (case-sensitive) and write
down the Block Check Character (BCC) in hexadecimal.
7 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Question 6 (6 marks):
a) [3 marks]
Use the division algorithm shown in lectures to divide these 4 bit binary numbers. Write
down the quotient and remainder and show all of your working:
1101 divided by 0100
b) [3 marks]
Use the multiplication algorithm shown in lectures to multiply these 4 bit binary numbers.
Show all of your working:
1010 multiplied by 1101
8 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Question 7 (6 marks):
Consider the following is a Hex-Dump of a section of computer memory:
_Addr__:__0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F
0x8590 : B8 BE 7D 36 4C 68 2F 60 D3 C6 22 EB 15 EB 38 41
0x85A0 : 41 AD D6 95 04 0C 2D 17 3E 33 A2 91 09 3E 62 6F
0x85B0 : 52 9B F9 48 03 28 A9 D7 EF CB C2 04 B6 FB 46 F8
0x85C0 : A8 1C 8D AC 28 BA C3 67 EE 66 F8 F7 A4 15 BA A1
0x85D0 : B0 B3 EA B4 DB 93 8B CB 5E 4E CF 15 49 15 0D F2
a) [2 marks]
Using the Hex-Dump above, what is the 3 byte value stored at memory address 0x85CE
using little endian addressing?
b) [2 marks]
Convert 0x546175 to ASCII using 1 byte per character.
c) [2 marks]
Identify one of the key responsibilities of an Operating System Kernel.
9 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Question 8 (6 marks):
a) [2 marks]
Identify and describe the purpose of one of the CPU registers involved in the Fetch-DecodeExecute cycle.
b) [2 marks]
What is the purpose of an Opcode?
c) [2 marks]
Explain the purpose of the Control Unit.
10 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
End of Examination
11 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Appendix A
This section contains additional information only and does not contain any exam questions.
ASCII Table
Appendix A
This section contains additional information only and does not contain any exam questions.
ASCII Table
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
000
NUL
BS
DLE
CAN
SP
(
0
8
@
H
P
X
`
h
p
x
001
SOH
HT
DC1
EM
!
)
1
9
A
I
Q
Y
a
i
q
y
010
STX
LF
DC2
SUB
"
*
2
:
B
J
R
Z
b
j
r
z
011
ETX
VT
DC3
ESC
#
+
3
;
C
K
S
[
c
k
s
{
100
EOT
FF
DC4
FS
$
,
4
<
D
L
T
\
d
l
t
|
12 of 16
101
ENQ
CR
NAK
GS
%
5
=
E
M
U
]
e
m
u
}
110
ACK
SO
SYN
RS
&
.
6
>
F
N
V
^
f
n
v
~
111
BEL
SI
ETB
US
'
/
7
?
G
O
W
_
g
o
w
DEL
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Logic Gates
13 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
6800 Reference
====================================================
Programming Reference
====================================================
Assembly statements contain the following fields:
[Label] Operation [operand] [comment]
Label:
Can be used to define a symbol, to
skip the field use a blank or tab
Operation: Defines the opcode or directive
opcodes are not case sensitive
Operand:
Contains an address or the data
ignored with inherent addressing
Comment:
Used for software documentation
can be at end or start of statement
uses a semicolon to start the comment
Examples: label adda 3
;comment here
adda label
clra
;inherent address
; this is a full line comment
====================================================
Assembler: Tag
Description
Example
Directives: ---------------------------------------.org
Where to put code .org $200
.equ
Define Constant
.equ 100
.set
Define Constant
.set 100
.rmb
Reserve Memory
.rmb 16
.byte
Define Variable
.byte 64
Array of bytes
.byte 1,2,3
.word
Define Variable
.word 5000
array of words
.word 1,2,3
.str
Define string
.str "text"
array of strings .str "a","b"
.end
End of Program
.end
====================================================
Number:
Prefix Description
Example
Format:
---------------------------------------Decimal
320
$
Hex
$240
%
Binary
%0110101
'
Character
'm
====================================================
Operand:
Format Description
Examples
REF
Formats:
---------------------------------------Inherent
clra
H
#<data> Immediate
ldaa #4
I
<data>
Relative
bra 10
R
<data>
Direct,Extended ldaa 4
D,E
ldaa label
<data>,x Indexed
ldaa 4,x
X
14 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
====================================================
Instruction Reference
====================================================
Status Flags:
H I N Z V C
| | | | | |
| | | | | --| | | | -----| | | --------| | -----------| --------------------------------
Carry-Borrow
Overflow
Zero
Negative
Interrupt Mask
Half Carry
====================================================
Nnemonic Operation
Mode Status
Branch and Jump -------------------------HINZVC
BRA
Branch Always
R -----BCS
Branch if Carry Set
[C=1] R -----BCC
Branch if Carry Clear
[C=0] R -----BMI
Branch if Minus
[N=1] R -----BPL
Branch if Plus
[N=0] R -----BVS
Branch if Overflow Set [V=1] R -----BVC
Branch if Overflow Clear[V=0] R -----BEQ
Branch if Equal
[Z=1] R -----BNE
Branch if Not Equal
[Z=0] R -----BLT
Branch if < (signed)
R -----BLE
Branch if <= (signed)
R -----BGE
Branch if >= (signed)
R -----BGT
Branch if > (signed)
R -----BLS
Branch if Lower or Same (unsgn)R -----BHI
Branch if Higher (unsigned)
R -----BSR
Branch to Subroutine
R -----JSR
Jump to Subroutine
EX -----JMP
Jump Absolute
EX -----RTS
Return from Subroutine
H -----Accumulator Only ------------------------HINZVC
===> NEMz can be either NEMA or NEMB <===
ASLz Arithmetic Shift Left A
H --****
ASRz Arithmetic Shift Right A
H --****
LSRz Logical Shift Right A
H --0***
ROLz Rotate Left A
H --****
RORz Rotate Right A
H --****
CLRz Clear Accumulator A [A <- 0] H --0100
COMz One's Complement A
H --**01
DECz Decrement A
[A <- A - 1] H --***INCz Increment A
[A <- A + 1] H --***NEGz Negate A
[A <- 0 - A] H --****
PSHz Push Accumulator
H -----PULz Pull/Pop Accumulator
H -----TSTz Test A
[A <- A - 0] H --**00
ABA
Add Accumulators [A <- A + B] H *-****
CBA
Compare Accumulators [A - B] H --****
DAA
Decimal Adjust A
H --****
SBA
Subtract Accumulators [A<-A-B] H --****
TAB
Transfer Accumulator [B <- A] H --**0TBA
Transfer Accumulator [A <- B] H --**0-
15 of 16
1007ICT - Introduction to Computer Systems & Networks Final Examination, Semester 1, 2014
Memory Reference ------------------------HINZVC
===> NEMz can be either NEMA or NEMB <===
LDAz Load Accumulator [A <- M]
IDXE --**0STAz Store Accumulator[M <- A]
DXE --**0ADCz Add with Carry
[A <- A+M+C]IDXE --**0ADDz Add
[A <- A+M] IDXE --**0SBCz Subtract w. Carry[A <- A-M-C]IDXE --**0SUBz Subtract
[A <- A-M] IDXE --**0BITz Bit Test
[A and M]
IDXE --**0ANDz Logical AND
[A<- AandM] IDXE --**0EORz Exclusive OR
[A<- AxorM] IDXE --**0ORAz Inclusive OR
[A<- Aor M] IDXE --**0CMPz Compare Memory
[A - M]
IDXE --****
ASL Arithmetic Shift Left
XE --****
ASR Arithmetic Shift Right
XE --****
LSR Logical Shift Right
XE --0***
ROL Rotate Left Memory
XE --****
ROR Rotate Right Memory
XE --****
CLR Clear Memory
[M <- 0]
XE --0100
COM Complement Memory[M <- !M]
XE --**01
DEC Decrement Memory [M <- M - 1]
XE --***INC Increment Memory [M <- M + 1]
XE --***NEG Negate Memory
[M <- 0 - M]
XE --****
TST Test Memory
[M - 0]
XE --**00
Stack and Index -------------------------HINZVC
CPX
Compare X
IDXE ---*-DES
Decrement SP [SP <- SP - 1]
H -----DEX
Decrement X
[ X <- X - 1]
H ---*-INS
Increment SP [SP <- SP + 1]
H -----INX
Increment X
[ X <- X + 1]
H ---*-LDS
Load SP
IDXE --**0LDX
Load X
IDXE --**0STS
Store SP
DXE --**0STX
Store X
DXE --**0TSX
Transfer SP,X [X <= SP + 1]
H -----TXS
Transfer X,SP [SP <= X - 1]
H -----Status Flags ----------------------------HINZVC
CLC
Clear Carry
H -----0
CLV
Clear Overflow
H ----0CLI
Clear Interupt Mask
H -0---SEC
Set Carry
H -----1
SEV
Set Overflow
H ----1SEI
Set Interupt Mask
H -1---TAP
Set Status Mask
[Flags<-ACC] H ******
TPA
Load Status Flags [ACC<-Flags] H -----Miscellaneous ---------------------------HINZVC
NOP
No Operation
H -----WAI
Wait for key press
H -1----
16 of 16