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....

1 answer below »
Three questions - first on basic Binary Arithmetic, second on Linux/Linux scripting - see attached PDF for full details.


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 carries, 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 11101001 represent 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-simulator/ 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 brief 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-simulator/ 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 9 1752 (do 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 correctly (Screenshot the result 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 browser program on the VM. To run it, type:  lynx www.google.com In the lynx browser, 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’ correctly. 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 correct 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 correctly
Answered Same DayApr 17, 2021

Answer To: Computer Architecture and Technology Convergence Assignment Q1: Binary Arithmetic: Feel free to use...

Pratik answered on Apr 21 2021
158 Votes
Shell/Linux_Ass.docx
Table of Contents
    
Q 1.1 Binary Addition
Add 11011 to 1011
Carry     1     1     0     1     1    
Answer 
            
11011+1011 = 100110’
Q 1.2 8 bit 2’s complement integers
Rewrite the following base-10 numbers as 8-bit two's complement intege
rs: -31, & -59
-31
31 in binary is written as 0001 1111
2’s complement is -31 . Hence , 2’s complement of 0001 1111 is 1110 0001
-59
59 in binary is written as 0011 1011
2’s complement is -59. Hence 2’s complement if 1100 0101
Hence,
-31 = 1110 0001
-59 = 1100 0101
Q 1.3
What does the bit pattern 1110 1001 represent if you interpret it as an 8-bit two's
complement integer?
Let’s back-trace it.
1110 1001  2’s complement
1110 1000  1’s complement (Subtract 1)
0001 0111  Original Number (Invert 1’s complement)
0001 0111 is 33 in 8 bit representation.
Hence, 1110 1001 is -33
Q 1.4 Truth Table
Truth Table for the given logic diagram is as follows :
D = X XOR Y
Bout = (NOT X) AND Y
        X
        Y
        D
        Bout
        0
        0
        0
        0
        0
        1
        1
        1
        1
        0
        1
        0
        1
        1
        0
        0
Q 1.5 Draw Circuit Diagram
Given Equation is (AB+C)D
AAND
B
OR
CAND
D
Q 2.1 Linux Commands        
Brief Description of each command :
· echo hello world – Writes “hello world”to the console
· passwd – changes password for the current user
· date – shows the current system date
· hostname – show the system’s hostname
· arch – shows the system cpu architecture
· uname –a – Prints the complete system information
· dmesg | more – Prints the kernel ring buffer with crt viewing
· uptime – system up time
· whoami – prints effective userid
· who – shows who is logged in
· last – list logins on the system
· finger – check information of any user (Deprecated now )
· w – Show who is logged in and what are they doing
· top – display linux processes
· echo $SHELL – displays the value of environment variable SHELL
· echo {con,pre}{sent,fer}{s,ed} – prints all valid combinations of the mentioned strings
· man ls – shows the manual page for the command “ls”
· man who – shows the manual page for the command “who”
· clear – clears the screen
· cal 2000 – displays the calendar for year 2000
· cal 9 1752 – displays the calendar for September 1752
This was the year when British Empire had to skip 11 days inorder to match the Catholic Calender. Hence, fewer than normal days.
· yes please – prints “please” in a infinite loop
· time sleep 5 – displays the time required to run the command sleep
· history – displays the command line history
Screenshots –
Q2.2 Shell Script
Shell Script :
        date
echo ' '
hostname
echo ' '
arch
echo ' '
uname -a
echo ' '
uptime
echo ' '
whoami
echo ' '
who
echo '...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here