Computer Science Concepts and Programming

Verified

Added on  2019/09/16

|10
|980
|384
Quiz and Exam
AI Summary
The assignment content discusses various computer-related topics, including the Fetch-Decode-Execute cycle, von Neumann Architecture, Little-Man Computer, DOS and Linux commands, batch scripting, data structures (Queue, Stack, Heap), Job Scheduler, process statuses, Process Control Block, deadlock, file storage allocation schemas, and Access Control Matrix. The content also includes a programming question to write a program using the Little-Man Computer to calculate the sum of two numbers.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Please as much as you can don’t write an essay
for the question try to draw diagram and if write
a long answer try to under line the most
important words and try to simplify and write a
clear answer not an essay the important point

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
1. (a) Explain what is meant by the Fetch-Decode-Execute cycle.
(5
Ma
rks
)
1. (b) Briefly describe what is meant by the term
von Neuman Architecture.
(5
Ma
rks
)
1. (c) The Little-Man Computer provides an
analogy for the execution of a computer
program, explain what each of the following
represent in the analogy to a real computer:
(i) The Pigeon-holes
(2
Ma
rks
)
(ii) The In-Tray
(2
Ma
rks
)
(iii) The Program Counter
(2
Ma
rks
)
(iv) The Calculator
(2
Ma
rks
)
(v) The Out-Tray
(2
Ma
rks
)
Document Page
Question One is continued overleaf
PAGE 2 OF 7
Document Page
1. (d) The Little Man model uses a single-digit op-
code and a 2-digit memory addressing and
has the following instructions defined where
the address portion is shown as xx.
OpCode Instruction Description
1xx ADD Add the value of a given memory location to
calculator
2xx SUBTRACT Subtract the value of a given memory location to
calculator
3xx STORE Copy the value from the calculator into a given
memory location
5xx LOAD Copy the value from a given memory location into
the calculator
6xx BRANCH Unconditional branch. Set the Program Counter to
value xx
7xx BRANCH IF Conditional branch. If the accumulator is zero,
ZERO branch to xx
8xx BRANCH IF Conditional branch. If the accumulator is positive,
POSITIVE branch to xx
901 INPUT Get the value from the IN-TRAY and put it into the
calculator
902 OUTPUT Put the value in the calculator into the OUT-TRAY
000 HALT Take a break
Write a program using these codes to take two
numbers which are contained in the IN-TRAY
and display the sum (+) of those numbers in the
OUT-TRAY. Comment every instruction.
(20
Mar
ks)

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
PAGE 3 OF 7
Document Page
2. (a) Explain what the following DOS commands do:
(i) dir
(2 Marks)
(ii) path
(2 Marks)
(iii) help
(2 Marks)
(iv) echo
(2 Marks)
(v) tree
(2 Marks)
2. (b) Explain what the following Linux/Bash commands do:
(i) cat
(2 Marks)
(ii) clear
(2 Marks)
(iii) pwd
(2 Marks)
(iv) ls
(2 Marks)
(v) man
(2 Marks)
Question Two is
continued overleaf
PAGE 4 OF 7
Document Page
2. (c) Write a DOS Batch script to automatically
recursively backup files from a specified directory
(and all its sub-directories), to a newly create
directory called BackupFolder (with the same
sub-directories). Finally list all the files
recursively in the new BackupFolder.
(3 Marks)
Suggest a name that you would give to
the file with the instructions in it?
(1
Ma
rk)
What would you type in to the command prompt to execute it?
(1
Ma
rk)
2. (d) Write a Bash/Linux script to automatically
recursively backup files from a specified directory
(and all its sub-directories), to a newly create
directory called BackupFolder (with the same
sub-directories). Finally list all the files
recursively in the new BackupFolder.
(3 Marks)
Suggest a name that you would give to
the file with the instructions in it?
(1
Ma
rk)
What would you type in to the command prompt to execute it?
(1
Ma
rk)

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
PAGE 5 OF 7
Document Page
3. (a) Explain the following data structures,
including in each explanation a diagram:
(i) A Queue
(2
Ma
rks
)
(ii) A Stack
(2
Ma
rks
)
(iii) A Heap
(2
Ma
rks
)
3. (b) Explain the purpose of the Job Scheduler.
(6 Marks)
3. (c) What are the five (5) statuses a process can
have, and what transitions are permissible
between states. Illustrate your answer with a
diagram, and an explanation of each state.
(9
Ma
rks
)
3. (d) What are the fields in the Process Control
Block (PCB)? Provide an explanation for
each field.
(9 Marks)
Document Page
PAGE 6 OF 7
1 out of 10
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]