COMPSCI110 - 1215
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
Select one alternative
I agree
1 Binary Quantity
For these questions enter the answer using decimal digits.
If 2 is the closest power of 2 to 120,000 what is the value of n?
How many bits are necessary to store the binary number equal to 120,000?
What is the decimal value of the binary number 100000?
How many bits are necessary to store the binary number equal to the hexadecimal 400000?
n
Maximum marks: 4
2 About signed reps
For these questions enter the answer using decimal digits. Include the negative sign if the answer
is negative e.g. -4400
What is the most negative number we can represent with 7-bit two's complement representation?
If a computer only works with 7-bit one's complement numbers what would the computer give as
the answer to 60 + 4?
If a computer only works with 7-bit two's complement numbers what would the computer give as
the answer to 60 + 4?
Maximum marks: 3
3 Floating point
These questions are using the textbook's floating point format that was introduced in lectures.
Given the floating point number 1110 0000 0000 0011 :
What is the sign of the number?
Select one alternative
What is the binary number of the mantissa? (Write your answer starting with "0." as the mantissa
is normalised.)
What is the exponent as a decimal number? (Careful with the sign.)
What is the decimal number represented by the floating point number 1110 0000 0000 0011?
Positive
Negative
Maximum marks: 2
4 ASCII & Unicode
Select all of the statements which are correct about ASCII and UTF-8.
Select one or more alternatives:
The UTF-8 codes for the letters A to Z are only one bit different from the corresponding
codes for the letters a to z.
The ASCII code only encodes printable characters.
ASCII is an extension (superset) of UTF-8.
ASCII digits can be turned into their 8-bit binary equivalents by clearing the top (most
significant) four bits of the character.
Maximum marks: 2
5 Boolean expressions TT
Select all boolean expressions which match this truth table.
A B Result
0 0 0
0 1 1
1 0 1
1 1 0
Select one or more alternatives
Maximum marks: 2
6 Truth table from circuit
Given the circuit diagram below complete the truth table showing the values of the Output.
Truth Table
x y z Output
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Maximum marks: 2
7 Von Neumann Architecture (Exam)
The following question is based on the textbook architecture discussed in lectures. The registers
used by this architecture make up the columns of the table below. Descriptions of what these
registers do make up the rows of this table. Match the descriptions to the appropriate register.
Please match the values:
MDR R MAR IR PC
Holds the encoding of the current instruction.
Holds the address of the next instruction.
Receives fetched data and holds data to be stored.
Holds the memory address to access.
Holds data used by the ALU.
Maximum marks: 3
8 State Diagram (Exam)
Answer the following questions using the state diagram below:
Starting at State A, what state would you transition to given the input 0110011?
(A, B, C, D, E, F)
Starting at State E, which state would you transition to given the input 0011110010?
(A, B, C, D, E, F)
Which state would you have to start at to be able to transition to every other state?
(A, B, C, D, E, F)
Select alternative
Select alternative
Select alternative
Maximum marks: 3
9 Assembly Output 1 (Exam)
Given the provided instruction set and assembly program, answer the following questions.
What is the output of the above assembly program given the inputs 1 and 4 (in that order)?
What is the output of the above assembly program given the inputs 7 and 5 (in that order)?
Maximum marks: 3
10 Assembling (Exam)
Given the provided instruction set and assembly program, convert the following lines of
assembly code from the program into the equivalent machine code. All of your answers should
be in binary. Do not use any punctuation, symbols or spaces.
Line 5:
Line 8:
Line 11:
Line 21:
Maximum marks: 3
11 Pseudocode (Exam)
Given the following pseudocode:
What output is produced when value4 = 1 and value5 = 5? Please only add spaces or other
formatting if required.
What output is produced when value4 = 13 and value5 = 4? Please only add spaces or other
formatting if required.
Maximum marks: 3
12 Compilation - Tokens and Token Classes
Identify the number of tokens and token classes in the following high level programming
language source code:
The number of tokens is .
The number of token classes is
Maximum marks: 2
13 Parse Tree
The following grammar is used to generate the parse tree shown below:
Identify the non-terminals at the labels marked in the tree.
A (
(
C (
E (
(
How many productions does the parse tree contain? (25, 17, 20, 19, 21)
Given that Celsius and Fahrenheit are variables of type real, the given high-level statement is
syntactically correct but semantically wrong. (False, True)
Select alternative Select alternative
Select alternative Select alternative
Select alternative Select alternative
Select alternative
Select alternative
Maximum marks: 4
14 Goal Symbol
Consider the following BNF grammar:
q | r | s | t | u | v | w | x | y | z
Which of the following strings will parse to this grammar's
Select one or more alternatives:
asha932
abcd000
zzz45
a345
fbc123
qw567
Maximum marks: 2
15 BNF Grammar for HexDigit
You are trying to write a BNF grammar to match a single hexadecimal digit (the goal symbol is
Choose what to write:
1|2|3|4|5|6|7|8|9, INT_DIGIT)
A|B|C|D|E|F|
Select alternative
Select alternative
Select alternative
Maximum marks: 3
16 Code Generation from Parse Tree
The parse tree shown in the figure is based on the following grammar:
Given that x, y and z are integers and that the compiler assigns pseudo-names such as temp1,
temp2 etc. for semantic records corresponding to productions that combine two or more non-
terminals, which of the following semantic records will be contained in the symbol table for this
parse tree?
Select one or more alternatives
x:integer
temp1:integer
-:operator
y:integer
z:real
expression:integer
temp2:real
result:real
result:integer
+:operator
Maximum marks: 1
17 OS - Generations
Choose the features that match the given generation of Operating Systems
Please match the values:
Batch
OS
Multi-
programmed
OS
Networked
OS
Naked
Machine
Time-
shared
OS
Distributed
OS
Loads many
user programs
simultaneously
into memory.
The processor
time is shared
among
multiple active
users.
Programmers
operated the
machine with
little software
support.
Introduced the
use of a
command
language (or,
job control
language)
Users do not
need to know
the location of
a remote
resource to
access it.
Allows remote
access to
resources over
a LAN.
Maximum marks: 2
18 OS - Time Slices
There are five batch processes that need to be executed on a time-shared single processor
system. All processes arrive at time instant 0 in the order A, B, C, D and E and are serviced in
that order. A requires 700ms of processing time, B requires 500ms, C requires 200ms, D
requires 900ms and E requires 400ms.
How long will it take the following processes to complete, given that the time slice is set to
100ms and there are no context switches?
1. Process C ms
2. Process E ms
Now, assume that the OS runs for 20ms at the beginning and between each process to
switch context. How long will it take the following process to complete?
1. Process E ms
What would be the efficiency of the processor in the above scenario, that is with context
switches? Enter your answer to two decimal places. %
Maximum marks: 4
19 OS - Deadlock
The resource allocation graphs for two different scenarios are shown below.
Which of the following statements are true?
Select one or more alternatives:
In (b), P3 has acquired one unit of r3 and is waiting for r2.
Neither (a) nor (b) represents a deadlocked state.
The processes in (a) are deadlocked.
The processes in (a) would never be in a deadlocked state if the system had three units of
each resource (r1 and r2).
The processes in (b) are deadlocked.
In (a), P3 has acquired one unit of r1 and is waiting for r2.
Both (a) and (b) represent deadlocked states.
Maximum marks: 2
20 Linux File Permissions
The ls -l command gives the following output on a Linux machine :
Which of the following statements are true?
Select one or more alternatives
Logged in as user asha946, what command will you issue to change the permissions of the file
lecture1, such that it is readable by all users on the system.
(chmod, chgrp, setperm, cd, chown) (uo+r, ugo+rwx,
ug+r, go-wx, go+r)lecture1
Logged in as user asha946, what command will you issue to change the permissions of the
directory 110 such that it has all permissions for the owner, read and write permissions for users
belonging to group all and read permissions for everyone else.
(chperm, setperm, chmod, chown, chgrp) (744, 664,
754, 752, 661, 764)110
Assuming that you were logged in as root, what command would you use to transfer ownership
of the file lecture1 to user ssin820.
(setuser, chmod, chgrp, chuser, chown)
(asha946:ssin820, asha946, +ssin820, ssin820)lecture1
Users belonging to group all can see the files in directory test.
CompSci is a file with no permissions for anyone except the owner.
lecture1 is a file that cannot be opened by anyone except the user asha946.
The file lecture1 can only belong to one group, which is all.
110 is a directory that is executable by all users on the system.
Select alternative Select alternative
Select alternative Select alternative
Select alternative Select alternative
Maximum marks: 4
21 Access Networks
Match the characteristics of the following access networks to their respective technologies
Please match the values:
Hybrid
Fiber
Coaxial FTTH
Cable
Network Ethernet WiFi ADSL
Uses existing copper
phone lines for Internet
access.
Shared broadcast medium
built on top of existing
cable TV infrastructure.
Uses fiber optic cables to
connect central office to
customer premises.
Connects devices in a
wireless LAN.
Connects devices in a
wired LAN.
Uses both optical fiber and
coaxial cable to provide
Internet access.
Maximum marks: 3
22 Transmission time
You need to transmit a hi-res image consisting of 12 megapixels (1 megapixel = 1,000,000
pixels), where each pixel is encoded using 3 bytes.
How long will it take to transmit the image on each of the following transmission media? Enter
your answer in seconds as a decimal value.
A 2Mbps DSL line seconds
A 100Mbps Fast Ethernet seconds
A 1Gbps Gigabit Ethernet seconds
If the image is first compressed before being transmitted using a compression ratio of 20:1, how
long will it take to transmit the compressed image over a 2Mbps DSL line?
Enter your answer in seconds as a decimal value. seconds
Maximum marks: 2
23 Packetization
The maximum transmission unit (or MTU) of an IP packet on 100 Mbps Ethernet is usually set at
1500 bytes. We need to send a file of 100MB.
How many IP packets will we need in each of the following cases?
Using the IPv4 protocol, where the network layer adds a 20-byte header and the transport layer
adds an 8-byte header.
Using the IPv6 protocol, where the network layer adds a 40-byte header and the transport layer
adds a 20-byte header.
Maximum marks: 2
24 Packet's Journey
An IPv6 packet between two hosts passes through 3 switches and 5 routers until it reaches its
destination.
Which of the following facts are TRUE about the journey of the packet between the sending
application and the receiving application?
Select one or more alternatives:
It is handled 15 times at the Link layer.
To ensure that the packet reaches the receiving application, the sending application must
use the TCP protocol at the transport layer.
The packet may get lost during its journey between the sender and the receiver.
All 5 routers along the way must be IPv6 routers for the packet to reach its destination.
It is handled twice at the Transport layer.
It is handled 5 times at the Network layer
Maximum marks: 2
25 Packets, Layering & Encapsulation
The process of transmitting data over a network by breaking it into discrete self-
contained chunks is called (forwarding, routing, circuit switching, packet
switching).
(Circuit switching, Frequency Division Multiplexing, Time
Division Multiplexing, Packet switching) is a networking technology that provides a dedicated
connection between the source and destination for the duration of the session.
A packet in a packet-switched network consists of two parts - a (name,
protocol, source address, payload) and a (layer number, destination
address, identifier, header).
Encapsulation helps maintain a logical separation of each layer in the TCP/IP protocol stack by
hiding its functionality in the (payload, header, checksum, version) field of
the packet.
An IPv6 node on the sending side of an IPv4 tunnel (used to connect IPv6 routers) takes the
entire (TCP, UDP, IPv6, IPv4) datagram and puts it in the payload field of
an (802.11, IPv6, Ethernet, IPv4) datagram.
(SMTP, TCP, FTP, IP, UDP) is a reliable, in-order delivery protocol that
runs at the Transport layer in the TCP/IP protocol stack.
Select alternative
Select alternative
Select alternative
Select alternative
Select alternative
Select alternative
Select alternative
Select alternative
Maximum marks: 2
2026-02-06