Computer Architecture and Technology Convergence Assignment
Q1: Binary Arithmetic:
Feel free to use any resources you need for the tasks below, but make sure to show workings.
Q1.1. Add 11011 to 1011. Show your work (in particular, show where you get ca
ies, and
where you don't). You can check your work by translating the numbers into decimal, but I
want to see the addition algorithm in base 2 instead of base ten. Hint: You can use MS
Word tables to show calculations. Goto Insert->Table to insert a grid of desired size
Q1.2. Rewrite the following base-10 numbers as 8-bit two's complement integers: -31, & -59.
Q1.3. What does the bit pattern XXXXXXXXXXrepresent if you interpret it as an 8-bit two's
complement integer?
Q1.4. Draw up the truth table for the circuit below (inputs are X and Y and outputs are B and D).
From observing the result, what function do you think this circuit performs?
Q1.5. Draw the circuit diagram for the Boolean logic equation: (AB + C)D (Hint: you can use an
online logic gate simulator such as: https:
academo.org/demos/logic-gate-simulato
and screen-capture your drawing)
Q2: Linux Assignment
Q2.1:
Enter the commands below at the Linux terminal on the AWS VM (on which you completed your
Linux Homework), and try to interpret the output.
For the submission:
In your own words, write a
ief description of what each command does. Make sure to use Google
as a resource and don't be afraid to experiment (as a normal user you cannot do much harm). Also
include a screenshot of the output of the history command. Copy the screenshot into your “.docx”
document for submission.
https:
academo.org/demos/logic-gate-simulato
Commands:
o echo hello world
o passwd
o date *
o hostname *
o arch *
o uname -a *
o dmesg | more (you may need to press q to quit)
o uptime *
o whoami *
o who *
o last
o finger *
o w *
o top * (you may need to press q to quit)
o echo $SHELL
o echo {con,pre}{sent,fer}{s,ed}
o man ls (you may need to press q to quit)
o man who (you may need to press q to quit)
o clear
o cal 2000
o cal XXXXXXXXXXdo you notice anything unusual. Why is
this the case?)
o yes please (you may need to press Ctrl-c to quit)
o time sleep 5
o history *
Q2.2:
This is a research project. Use Google to help you identify a solution.
For each of the commands marked with an *, group them into a shell script so that you can
automate execution of the commands. Write the shell script using the Vim text editor.
Once you have verified that the script works, add output redirection to append the output of each
command to a file named as follows: firstnameSurname.txt (replacing firstname and surname with
your own details). When writing to this text file, make liberal use of the echo command within the
shell script to format the output nicely – i.e. insert blank lines or other demarcations and headings to
make your file easily readable.
For the submission:
Copy and paste the contents of this auto-created “.txt” file into your “.docx” document for
submission. You are also required to upload the shell script which you wrote and the text file which
it generated.
Q2.3:
Q2.3.1:
When a user account is created on Linux, it is public to all users of the machine by default. That is,
anyone can view your personal files. Change the access permissions using the ‘chmod’ command so
that your personal folder is fully accessible to you (read, write and execute privileges) and totally
inaccessible to the group and all other users.
Look at the lecture notes to work out how to do this.
Run the “ls –l” command to verify that the permissions have been set co
ectly (Screenshot the
esult from this for submission).
Q2.3.2:
Because there is no GUI installed on the VM, all programs have to run instead in text mode.
Use the ‘lynx’ text-based
owser program on the VM. To run it, type:
lynx www.google.com
In the lynx
owser, search for an online IP location service to determine the city and country where
the VM is located. Type the IP address of the VM into the IP locator website and it will tell you the
VM’s location (Screenshot the result from this for submission).
For the submission:
Copy the screenshots above into your “.docx” document for submission.
Q2.4:
This is a research project. Use Google to help you identify a solution.
The objective of the task is to (using the Vim text editor) write a shell script program that behaves
like an Irish person offering a cup of tea.
If the user types ‘y’ to the offer, the program displays “Great, I’ll make tea now” to the console.
If the user types ‘n’ to the offer, the program asks the user “Are you sure” 4 more times before
giving up. If at any point during the 4 follow up offers, the user changes their mind and presses ‘y’,
the computer will print out “Great, I’ll make tea now” to the console.
In addition to shell scripting, this assignment examines your ability to use ‘while loops’ and’ if
statements’ co
ectly. It also examines your ability to research and locate the information required
online.
For the submission:
Capture a screenshot of the program in operation. Copy and paste the screenshot into your
document for submission. Also, copy and paste the shell script code into your Word document for
submission.
http:
www.google.com
Submission Instructions
Submit the following 3 files through the Moodle portal:
o 1 .docx document
o 1 shell script (from Q2.2)
o 1 text file entitled: firstnameSurname.txt (replacing firstname and surname with
your own details)
Do not zip your submission or submit a PDF
There is only one chance for submission so make sure you submit the co
ect version
Ensure that you show workings
Include table of contents
Use MS Word’s Headings – This will make it easier to generate table of contents and allow
for easier navigation (see instructions in video)
Hint: Use tables to demonstrate workings
Marks will be awarded for following above instructions co
ectly