COMP 1500 Fall 2022 Assignment 1
Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit
COMP 1500 Fall 2022
Assignment 1
Use a word processing app (e.g. Word or Google Docs) to prepare your answer. Submit your document in pdf (Acrobat) format. Use Moodle to submit your file.
Question 1: Online tools and binary addition (5 marks)
a) [1 mark] Go to Online Random Tools (https://onlinerandomtools.com/generate- random-bytes ) and generate 4 random byte (in binary). Make a screen capture of your random bytes that also includes your name and student number. The example below includes a text editor window.
b) [2 marks] Type the bytes from part a) (use a fixed width font such as Courier) and perform binary addition. Show the carry-in bit in the row above, in a different colour. Show the decimal equivalents to the right.
bbbbbbbbbb
bbbbbbbb (ddd)
+ bbbbbbbb (ddd)
+ bbbbbbbb (ddd)
+ bbbbbbbb (ddd)
============
bbbbbbbbbbb (dddd)
c) [2 mark] Convert the last 2 digits of your U of M student number into binary (if the last 2 digits are 00 then use 100 instead). Then, convert the binary number into equivalent Hexadecimal. Show your work for both conversions.
It is easy enough to run these values through a binary calculator for verification. You are reminded you are responsible for understanding how basic binary arithmetic operations work for the final exam.
Question 2: ASCII (5 marks)
a) [2 marks] Find an online hexadecimal file viewer, and open your text file from question 1 in it. Make a screen capture of the tool, showing both the ASCII and hexadecimal contents of your file. Make sure the site's address is included. In this example, the URL and name of the site are obscured:
b) [1 mark] Which OS (e.g. Mac, Windows) is running on the computer you are using? Give the specific version (e.g. MacOS Version 10.14.6).
c) [2 marks] Do some research to find at least four characters in the Extended ASCII character set, and the keyboard shortcuts that allow you to enter those characters directly from the keyboard. If possible, the characters should include letters in your name from question 1, otherwise add some new characters. Type the characters, AND the shortcuts you used.
For example: Jôhn Bénoït (option-i, o), (option-e, e), (option-u, i).
Question 3: Turing Machine Simulator (5 marks)
This question assumes you understand the fundamentals of a Turing Machine.
Go to https://turingmachinesimulator.com/ which is a web-based simulation of a Turing machine.
Create a Turing Machine that will 'accept' input that matches your 7-digit U of M student number only when the number of occurrences of the first digit from right in your student number is even. For example, if the student number is ‘7543215’, the first digit is 5 and there are two occurrences of 5 in the student number, the Turing machine will accept the input (the number of occurrences is two and it is even) but if the student number is ‘7543210’, the first digit is 0 and there are one occurrence of 0, the Turing machine will reject the input (the number of occurrences is one and it is odd). Remember the input tape contains decimal numbers. You may find the examples on the simulator web site useful. Paste the script for your Turing machine into your answer document.
Question 4: Boolean simplification (7 marks)
a) (4 marks) Given the Truth Table below with 3 inputs (A, B, C) and 1 output (Q), derive a sum-of-products Boolean expression for Q. Then, perform simplification on Q using Boolean algebra. Use the numbering of the Boolean algebra rules from the course notes to show which rules were used.
A |
B |
C |
Q |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
b) (3 marks) Given the Truth Table below with 4 inputs (A, B, C, D) and 1 output (Q), preform simplification on the table by inspection. Show the simplified expression and explain how you arrived at the simplified expression.
A |
B |
C |
D |
Q |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
0 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
1 |
0 |
0 |
0 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
0 |
1 |
1 |
0 |
1 |
1 |
0 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
1 |
1 |
1 |
0 |
0 |
1 |
1 |
1 |
1 |
0 |
Question 5: Circuit Design (3 marks)
Draw a diagram (using logic.ly/demo/ or any other circuit design app) that implements a combinational circuit for the following Boolean expression:
Q = A + C + A ⊕ B
Clearly label the inputs and output. Insert a screen shot of your circuit.
2022-10-10