7.3 KiB
Roll Number | @00677611 |
---|---|
ID | CHC119 |
Name | George Wilkinson |
1 - Linux Bash
1.1 - If Statements
1.2 - Processing Variable Number of Arguments with While, Using if
2 - Linux System Administration
Setup:
- Create sysadmin user:
- Add sysadmin to the root group
- Create global_aliases.sh and set permissions
- Create aliases:
- Add source for existing users:
- Create users:
- Create group for Hugh and Ryan
- Add Hugh and Ryan to the group
- Create shared directory
- Set permissions to directory to allow root and sharedaccess to read, write and execute, others can read
- Set permissions of all folders in /home/ to rwx for exclusively the user that owns it. Other users may not read, write or execute
Testing:
Aliases
Shared Directory:
Home Directories:
CSI Task 1
a)
i)
Since Boolean Algebra ( ., +, Line over ) is not possible to type in my text editor, I will use Boolean Expression Logic symbols ( ^, V, ¬) throughout the CSI task sections. I apologise for any inconvenience.
X = (A ^ B ^ C) v ( ¬A ^ B ^ ¬C) v ( ¬A ^ ¬B ^ C)
ii)
source: 1a.csv
b)
Truth Table:
source: 1b.csv
Karnaugh Graph:
AB | |||||
---|---|---|---|---|---|
00 | 01 | 11 | 10 | ||
C | 0 | 1 | 0 | 1 | 0 |
1 | 1 | 0 | 1 | 0 |
As we can see from the Karnaugh Graph, the output of C is completely irrelevant.
Boolean Expression:
OUT = (IN1 ^ IN2) ∨ ( ¬IN1 ^ ¬IN2)
Logic Circuit:
CSI Task 2
a)
Name | George |
---|---|
Decimal | 71,101,111,114,103,101 |
Binary | 1000111,1100101,1101111,1110010,1100111,1100101 |
8N2 | 0(Idle) 1(Start) 01000111 00(Stop) 1(Start) 01100101 00(Stop) 1(Start) 01101111 00(Stop) |
1(Start) 01110010 00(Stop) 1(Start) 01100111 00(Stop) 1(Start) 01100101 00(Stop) 0(Idle) |
b)
Sent | UTF-8 | Binary | UTF-8 | Received |
---|---|---|---|---|
G | 71 | 0100 0111 | 71 | G |
e | 101 | 0110 0101 | 101 | e |
o | 111 | 0110 1111 | 111 | o |
r | 114 | 0111 0010 | 114 | r |
g | 103 | 0110 0111 | 103 | g |
e | 101 | 0110 0101 | 101 | e |
Sum | 601 | 10 0101 1001 | 601 | |
Checksum | 89 | 89 |
601 mod
256 = 89
or,
10 0101 1001 AND
00 1111 1111
00 0101 1001 = 89
Example:
Sent | UTF-8 | Binary | UTF-8 | Received |
---|---|---|---|---|
G | 71 | 0100 0111 | 71 | G |
e | 101 | 0111 0101 | 117 | u |
o | 111 | 0110 1101 | 109 | m |
r | 114 | 0111 0010 | 114 | r |
g | 103 | 0100 0111 | 71 | G |
e | 101 | 0110 0101 | 101 | e |
Sum | 601 | 10 0100 0111 | 583 | |
Checksum | 89 | 71 |
Here we can detect an error in transmission, since the checksum differs on each side of the message. A checksum however cannot detect where an error occurs, just the fact that it has.
c)
( Equations and formulae written with LaTeX )
Baud Rate = \frac{Bitrate}{Bits Per Symbol}
Bit Rate = 2MBps
Bits Per Symbol = 8 data + 1 start + 2 stop = 11 bits
Baud Rate = \frac{16000000bps}{11b} = 1,454,545Baud = 1.454545MHz = 1454.545kHz
5F = 5 * \frac{Baud Rate}{2}
5F = 5 * 727.2725kHz = 3636.3625kHz = 3.636MHz
Required Bandwidth: 3.636MHz
CSI Task 3
a)
Page Accesses
- 1 2 3 4 5
- 2 3 4 1 5
- 3 4 1 2 5
Using the clock algorithm, there are 7 page faults total with this sequence of page accesses.
b)
Since A has a runtime of 4 seconds, it is impossible to allocate 4-7 (4, 5, 6, 7 -> 5 processes) second runtime with no conflicts, so I will allocate 4 in a process of my choice.
Response Ratio = \frac{Wait Time + Run Time}{Run Time}
Process | Runtime | Start Time | Response Ratio |
---|---|---|---|
A | 4 | 0 | 1 |
B | 5 | 1 | 1.2 |
C | 6 | 2 | 1.33 |
D | 7 | 3 | 1.43 |
E | 4 | 4 | 2 |
Process E has the highest Response Ratio, and will be scheduled first. Then Process D, Process C, B and finally A.
t (Time) | Complete Process | Start Process |
---|---|---|
0 | A | |
4 | A | E |
8 | E | D |
15 | D | C |
21 | C | B |
26 | B |
Since the only available process at t=0 is A, it must still be performed first, regardless of where it sits in the queue. E is then available at t=4, when A is completed, allowing the remaining queue to run in descending order of response ratio.