================================================================= Assignment #09 - Boolean Logic, Memory, and Internet ================================================================= - Ian! D. Allen - idallen@idallen.ca - www.idallen.com Available online: Tuesday March 23, 2010 Upload due date in the Blackboard Assignment Area: Upload "assignment09.txt" before 13:00 (1 pm) on Tuesday March 30, 2010. Do *not* use the DigitalDropbox to submit your answers. Answers will be posted shortly after the due date/time. Submission method: Upload via the "Assignments" CST8281_Assignment_09 upload. Use the file name given above. Upload only one single file of plain text, not HTML, not MSWord, not RTF. No fonts, no word-processing. Plain text only. Did I mention that the format is plain text (Notepad)? Due to bugs in Blackboard, you can only submit your Assignment to me *once*. After that, you cannot submit any more times. If you need to re-submit it, you have to email me to ask me to clear your previous submission. Do *not* use EMail or the DigitalDropbox to submit your answers. Answers will be posted after the due date/time so that you can check your answers before coming to labs and ask questions about the answers in the labs. Please check your answers (and my answers!). I go over each assignment in the lab if there are questions about the answers. No questions means no review - I'll presume you know the material. Questions similar to ones on these assignments will appear on your tests and exams. Not all assignments will be marked. See the Week 1 Notes for details. ============================================================================== Edit this file and answer the following questions underneath each question, showing how you obtained each answer, if appropriate. Answers without methods are worth zero. Upload the file containing the methods and the answers before the due date. Some of the answers below may require reading the URL links published in the weekly notes. ============================================================================== Make sure you can log in to the Course Linux Server before you begin. The command-line commands referenced in this lab should be executed in your own account on the Course Linux Server. ============================================================================== 0. What is the date of your second midterm test? *** Boolean Section *** Recall that "NOT x" can be written in text using the "prime" mark: x' 1. True/False: (xy)' == x'y' In English: "NOT(red AND jello) == NOT red AND NOT jello" ? 2. True/False: (x + y)' == x' + y' In English: "NOT(red OR jello) == NOT red OR NOT jello" ? 3. Using deMorgan, write a simplified expression for the Boolean complement of the logic function F(a,b,c) = a(b' + c) 4. Using deMorgan, write a simplified expression for the Boolean complement of the logic function F(a,b,c) = a + (b'c) 5. Show that x = xy + xy' using a Boolean truth table. 6. Prove that x = xy + xy' using a chain of simple Boolean Identities. 7. Construct a Boolean function F(a,b) that implements the XOR operator using only AND, OR, and NOT logic. (The truth table for the simple function should be the same as the XOR truth table.) 8. Write the simplest IF statement (simplify the Boolean logic) for the following programming problem specification: "Call the delete routine unless: the product_id is zero or the product_class is 'important'." 9. Write the simplest IF statement (simplify the Boolean logic) for the following programming problem specification: "A record is one where the modify_date date is less than a year old and the account_balance is bigger than zero. If the record is NOT current, call the delete routine." *** Memory Section *** 10. What do the acronyms RAM and ROM stand for? 11. Is the BIOS in your computer stored in RAM or ROM? 12. Put these in increasing order of access time (faster to slower) and indicate beside each type of device approximately what its access time is: Fixed Hard Disk Level 1 Cache Magnetic Tape Level 2 Cache Main Memory Optical Disk Registers 13. Define "a cache hit": 14. Define "a cache miss": 15. List and briefly describe the three Principles of Locality: 16. With reference to cache size, why is a small loop of code often faster than a large loop? 17. What is the basic feature that Virtual Memory enables? 18. What is the difference between a Physical Address and a Virtual Address? 19. What is a "page fault"? 20. How much slower (orders of magnitude) is a page fault compared to an ordinary memory access that does not cause a page fault? 21. With reference to virtual memory, why is a small program often faster than a large program? 22. What is virtual memory "thrashing"? 23. With reference to Chapter 6 Slides 46-47, describe what happens when the CPU generates the 13-bit address 1004h: *** Internet Section *** 24. IPv4 addresses are stored as 32-bits and sent around the Internet in Big Endian format, where each of the four "quads" is stored in its own byte. Encode the dotted-quad IP address 129.65.33.17 as a 32-bit hexadecimal number as it would be sent on the Internet: 25. Which of the following URLs are always identical to the URL http://idallen.com/address.html: a) HTTP://idallen.com/address.html b) http://IDALLEN.COM/address.html c) http://idallen.com/ADDRESS.HTML 26. Which of the following email addresses are always identical to the email address idallen@idallen.ca: a) IDALLEN@idallen.ca b) idallen@IDALLEN.CA 27. Which of the following cannot ever be valid dotted-quad IP addresses? a) 1.2.3.4 b) 0.0.0.0 c) 192.0.32.10 d) 292.0.32.10 e) 255.255.255.255 f) 255.255.255.256 28. True/False: If two machines with IP addresses 192.0.32.10 and 192.0.32.11 are on the same network, they will always have similar DNS names, e.g. host1.example.com and host2.example.com . 29. True/False: If two machines have similar DNS names, e.g. host1.example.com and host2.example.com, their IP addresses will always be on the same or similar networks, e.g. 192.0.32.10 and 192.0.32.11. 30. How many bits are used to store the new IPv6 Internet addresses? 31. In Class Notes file 140_attack.txt: Decode the obfuscated IP address assigned in hexadecimal to the $perm variable into standard Internet numeric dotted-quad form. Give the dotted-quad IP address here: Give the 32-bit hexadecimal form here: *** Using the Course Linux Server *** 32. Use the "whois" command to find out who owns the above IP address. In what country is that IP address registered? 33. The attack email listed in 140_attack.txt is said to come from an IP address provided by Verizon. Give the "host" and "whois" command lines that show this to be true, including only the relevant lines of output from each command: 34. The Perl script being fetched for the attack is said to come from a German IP address. Give the "host" and "whois" command lines that show this to be true, including only the relevant lines of output from each command: 35. Use the "traceroute" command to trace the packet routes between this machine and the German address. (The trace may not be able to trace all the way to the destination - some trace points will be asterisks instead of host names.) Copy and paste the traceroute here: -- | Ian! D. Allen - idallen@idallen.ca - Ottawa, Ontario, Canada | Home Page: http://idallen.com/ Contact Improv: http://contactimprov.ca/ | College professor (Free/Libre GNU+Linux) at: http://teaching.idallen.com/ | Defend digital freedom: http://eff.org/ and have fun: http://fools.ca/