Welcome to the MODD Zone

(Mathematics Of Digital Data, Block 6)

Are you nervous when you see NCWEE? concerned when you see CIRC? perturbed when you see PBC? Visit Mr. Hansen’s fabled abbreviations page to make sense of those cryptic markings you see on your papers.

 

Schedule at a Glance (see archives for older entries)
Written assignments should follow the HW guidelines.

 

T 9/1/15
X

First day of class.

 

 

W 9/2/15
A

No class.

 

 

Th 9/3/15
B

HW due: Order a copy of our course textbook. Rush shipping is not required, since there is plenty for us to work on until everyone has a textbook. Note that used copies are available for a very reasonable price.

 

 

F 9/4/15
C

HW due: Order the course textbook if you have not already done so.

In class: Continuation of “Bits, Bytes, Hex, and Hertz” after Thursday’s class was cut short by the fire drill.

 

 

M 9/7/15

No school (Labor Day).

 

 

T 9/8/15
D

HW due: Bring an example of an advertisement (video or print) that exhibits a digital artifact such as banding (a.k.a. posterization or false contouring), pixelation, or an unintended Moiré pattern. There are decent Wikipedia articles available on all of these topics, if you need a little more background reading. For extra credit, find three examples of advertisements: one exhibiting banding, one exhibiting pixelation, and one exhibiting an unintended Moiré pattern.

In class: Keep My Green Turtle PEZ-y, Hertz (Hz), AM and FM radio, show & tell of ham radio.

 

 

W 9/9/15
E

No class.

 

 

Th 9/10/15
F

HW due: Bring your textbook and Tuesday’s advertisement example.

In class: Egyptian and Roman numeration systems, base 10, base 5, base 2 (binary), base 16 (hex), and simple arithmetic.

 

 

F 9/11/15
G

HW due: Add 0xFACE + 0xB00C in binary, decimal, and hex.

In class: Verify answer (0x1AADA). Trick for adding “all F’s” to any hex value (analogy to adding “all 9’s” to any decimal value). Count from 00 to FF in hex. Discuss ASCII, Unicode, and the multitude of meanings that can be assigned to bytes depending on the application (numeric, text, video, audio, game state, etc.). Play around with text files in DOS, including the CTRL+G (bell) and CTRL+Z (end of file) characters.

 

 

M 9/14/15
A

No class.

 

 

T 9/15/15
B

HW due: Read from the bottom of p. 43 to the middle of p. 54; write #6, 8, 10, 19 on pp. 58-59.

 

 

W 9/16/15
C

HW due: Read pp. 59-79, and explore this website. Tinker with as many features on the website as you can!

 

 

Th 9/17/15
D

HW due: Read pp. 81-93; write p. 79 #6, 7, 8, 9.

 

 

F 9/18/15
E

No class.                             

 

 

M 9/21/15
F

HW due: Read pp. 103-135. Reading notes are required, as always. Make sure that you include in your reading notes the numbers in the margin on p. 112. Notice the pattern: If you consider the place values of the binary column (from right to left) as 1, 2, 4, and 8, then the decimal numbers are simply the sum you get by adding up the binary place values. For example 1101 means . . .

1 times 8 (since the place value of the leftmost position is 8), plus
1 times 4 (place value of 4), plus
0 times 2 (place value of 2), plus
1 times 1 (place value of 1 for the rightmost position.

Since 8 + 4 + 0 + 1 = 13, we use the binary pattern 1101 to represent 13.

Now, binary values are tedious, to put it mildly. In your reading notes, add a column for “hex shorthand” as follows:

 

 

 

 

Decimal

Binary

Hex Shorthand

 

 

 

 

 

0

0000

0

 

 

 

 

 

1

0001

1

 

 

 

 

 

2

0010

2

 

 

 

 

 

3

0011

3

 

 

 

 

 

4

0100

4

 

 

 

 

 

5

0101

5

 

 

 

 

 

6

0110

6

 

 

 

 

 

7

0111

7

 

 

 

 

 

8

1000

8

 

 

 

 

 

9

1001

9

 

 

 

 

 

10

1010

A

 

 

 

 

 

11

1011

B

 

 

 

 

 

12

1100

C

 

 

 

 

 

13

1101

D

 

 

 

 

 

14

1110

E

 

 

 

 

 

15

1111

F

 

 

 

T 9/22/15
G

HW due: Finish yesterday’s worksheet.

 

 

W 9/23/15
A

No class.

 

 

Th 9/24/15
B

HW due:

1. Read pp. 135-141.

2. Write p. 124 #7, 11.

3. Write pp. 142-143 #5, 9, 12.

 

 

F 9/25/15
X

Senior retreat. Danny and Mark must report for roll call; the others are excused.

 

 

M 9/28/15
C

HW due: Read pp. 181-198.

 

 

T 9/29/15
D

HW due: Read pp. 198-211.

 

 

W 9/30/15
E

No class.

 

 

Th 10/1/15
F

Report to MH-211 (Mr. Findler’s room) for a worksheet period today.

 

 

F 10/2/15
G

HW due: Neat version of yesterday’s worksheet. (Clean up as necessary.) If your version is already neat and well-organized, you have no additional work to do.

 

 

M 10/5/15
A

No class.

 

 

T 10/6/15
B

HW due:

1. Watch this video. You may want to watch it twice so that you absorb all of the concepts. The material is presented clearly and with good pacing. Everything in the video is worth learning. If you spot the minor typo in the video, the first student to send Mr. Hansen an e-mail describing the typo and the timestamp in the video where it occurs will get half a bonus point.

2. Read from the bottom of p. 231 through the bottom of p. 244.

3. You are given two 24-bit bitmaps, each 8 x 7 pixels in size (8 rows of 7 pixels each). The first, which we will call bitmap A, is an image of a purple plus sign (photographed against a blue-screen background), and its contents (in hex) are as follows:

0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF
0000FF 0000FF 0000FF 800080 0000FF 0000FF 0000FF
0000FF 0000FF 0000FF 800080 0000FF 0000FF 0000FF
0000FF 0000FF 800080 800080 800080 0000FF 0000FF
0000FF 0000FF 800080 800080 800080 0000FF 0000FF
0000FF 0000FF 0000FF 800080 0000FF 0000FF 0000FF
0000FF 0000FF 0000FF 800080 0000FF 0000FF 0000FF
0000FF 0000FF 0000FF 0000FF 0000FF 0000FF 0000FF

The second bitmap, which we will call bitmap B, is a checkerboard of yellow and red, and its contents (in hex) are as follows:

FFFF00 FF0000 FFFF00 FF0000 FFFF00 FF0000 FFFF00
FF0000 FFFF00 FF0000 FFFF00 FF0000 FFFF00 FF0000
FFFF00 FF0000 FFFF00 FF0000 FFFF00 FF0000 FFFF00
FF0000 FFFF00 FF0000 FFFF00 FF0000 FFFF00 FF0000
FFFF00 FF0000 FFFF00 FF0000 FFFF00 FF0000 FFFF00
FF0000 FFFF00 FF0000 FFFF00 FF0000 FFFF00 FF0000
FFFF00 FF0000 FFFF00 FF0000 FFFF00 FF0000 FFFF00
FF0000 FFFF00 FF0000 FFFF00 FF0000 FFFF00 FF0000

Using the block diagram on p. 243, show all the steps for superimposing the purple plus sign onto the checkerboard background. The first step is done for you as an example below.

To threshold bitmap A for blue (replacing all pixel values of 0x0000FF with 0x000001, all other values with 0x000000):

000001 000001 000001 000001 000001 000001 000001
000001 000001 000001 000000 000001 000001 000001
000001 000001 000001 000000 000001 000001 000001
000001 000001 000000 000000 000000 000001 000001
000001 000001 000000 000000 000000 000001 000001
000001 000001 000001 000000 000001 000001 000001
000001 000001 000001 000000 000001 000001 000001
000001 000001 000001 000001 000001 000001 000001

Note: If you wish, you may save writing by replacing all hex pixel values with a code denoting their values, as follows:

0x000000 = 0
0x000001 = 1
0x0000FF = B (blue)
0x800080 = P (purple)
0xFF0000 = R (red)
0xFFFF00 = Y (yellow)

If you adopt that approach, then the thresholded bitmap becomes

1 1 1 1 1 1 1
1 1 1 0 1 1 1
1 1 1 0 1 1 1
1 1 0 0 0 1 1
1 1 0 0 0 1 1
1 1 1 0 1 1 1
1 1 1 0 1 1 1
1 1 1 1 1 1 1

Similarly, the original bitmaps A and B could be denoted as

B B B B B B B
B B B P B B B
B B B P B B B
B B P P P B B
B B P P P B B
B B B P B B B
B B B P B B B
B B B B B B B

and

Y R Y R Y R Y
R Y R Y R Y R
Y R Y R Y R Y
R Y R Y R Y R
Y R Y R Y R Y
R Y R Y R Y R
Y R Y R Y R Y
R Y R Y R Y R

respectively. If you are not able to finish this exercise on your own, then come in during office hours on Monday, Oct. 5, any time between 2:45 and 3:30.

 

 

W 10/7/15
C

No additional HW due. Use the time to make sure that you are 100% caught up on all previously assigned work.

 

 

Th 10/8/15
D

HW due:

1. Read pp. 249-266.

2. From the exercises on pp. 266-267, write #9, 11, 18-21.

 

 

F 10/9/15

No school (faculty professional day).

 

 

M 10/12/15

No school (Columbus Day).

 

 

T 10/13/15
E

No class.

 

 

W 10/14/15
F

HW due: Sleep and rest. An oral report may be required!

In class: Endianness, ASCII, Unicode, nybbles, hex (review), SSD, caching, cache hits, cache misses.

 

 

Th 10/15/15
G

HW due:

1. Read pp. 268-274, 276, 281-288. Note that we are skipping p. 275.

2. On p. 278, write #1, 2, 7, 8, 10, 11, 15, 16, 22, 23, 29, 33.

 

 

F 10/16/15
A

No class.

 

 

M 10/19/15
B

HW due:

1. Complete your practice test. You may use the Windows calculator (calc.exe) to check your numeric answers, even the ones that are in hex. However, show all your work.

2. After you have finished all problems, check the answer key and make all corrections in a different color. Write a polite note to yourself addressing the reason for each error. Example: “Danny, remember that when taking the complement, you must always add 1 after flipping all the bits.” You will be graded on the quality of your corrections.

 

 

T 10/20/15
C

Review day.

 

 

W 10/21/15
D

Test (100 points) on all material covered so far.

 

 

Th 10/22/15
E

No class.

 

 

F 10/23/15
F

No additional written HW due. Use the time to recover from the test (which is looking pretty good, by the way), to enjoy the beautiful fall weather, and to get some much-needed sleep.

In class: Guest speaker, Mr. Dan Schaupner, CTO of Zeichner Risk Analytics (zra.com). The following cryptogram is worth puzzling over:

ymjhwfedgfxyfwixbjwjltnslitbsytymjuttqmfqqytuqfdfqnyyqjunsgf
qqbmjsymjnwhfwjcuqtijigqtbnsljajwdtsjytxrnymjwjjsxxtrjtkyzgg
dxkqjxmkqjbtkkytymjxnijtkymjwtfifsinsynrjstzwnxmjifxzskqtbjw
lwtbnslymjwjxttsymjxzskqtbjwbfxjfyjsgdfmtwxjfsiymjmtwxjbfxjf
yjsgdxtrjmtgtxtzyktwfbnqiynrjymjstsjtkymjmtgtxrjyfsjfxybfwib
fsijwnslhfsfinfslzwzgzygjktwjfsdymnslxnlsnknhfsyhtzqimfuujsy
mjmtgtinjigjnslfyyfhpjigdfitlmjfwynsfxhnjsynxyxqfgtwfytwdymj
ijfymbfxqnxyjifxfmjfwyfyyfhpymjsxqfajwdbfxfgtqnxmji

 

 

M 10/26/15
G

No additional HW due.

In class: more on aliasing, quantization noise, coding for format/compression/correction/encryption, lossy compression, lossless encryption, run-length encryption, Phil Katz, FFT, psychological tricks of MP3 encoding.

 

 

T 10/27/15
A

No class.

 

 

W 10/28/15
B

HW due: Read most of Chapter 6 (pp. 297-323).

In class: Steganography and phony ESP demonstration.

 

 

Th 10/29/15
C

HW due:

1. Attempt to solve the challenges on the steganography handout. If you are stuck for more than about 10 minutes, try switching to the other challenge, or do something different for a while.

2. Read pp. 325-330. Reading notes are required, as always.

 

 

F 10/30/15
D

HW due:

Write a short essay reflecting on what you have learned so far this semester in MODD. You may organize it as a bulleted list if you wish. Note: Don’t list topic areas; list facts or concepts that you actually learned. Recommended length is half a page to one page, handwritten.

WRONG:
I learned about bits, bytes, hex, Hertz, 2’s complement arithmetic, aliasing, digital imaging, and digital music. I have started to learn about encryption, error correcting codes, data compression, and information theory.

(The essay above is no good, since it is nothing more than a list of topics.)

BETTER:
I learned that a bit is the smallest unit of information, distinguishing between two states that can be thought of as 0 and 1. With a collection of n bits, I can represent 2n different patterns by means of binary encoding. I learned that 210 = 1024 or approximately 103. I learned that hex (hexadecimal) is a shorthand notation that lets me represent 4 bits with a single hex symbol. I became fairly skilled at counting, adding, and subtracting in hex. I learned what ASCII and MIDI stand for.

(This is much better, since it lists actual facts that the student seems to know quite well. However, it is incomplete, because it omits any awareness of aliasing, digital audio, A/D and D/A conversion, RGB color values, etc. Maybe the student didn’t learn those things as well as the others, but surely he learned something about them.)

 

 

M 11/2/15
E

No class.

 

 

T 11/3/15
F

HW due: Write pp. 324-325 #8, 14; p. 331 #2, 3, 4, 5.

 

 

W 11/4/15
G

HW due:

Convert the following power ratios to dB:

50:1, 70:1, 700:1, 70,000:1, 1:500, 1:1,000,000,000,000, and 1:200

Convert the following dB ratings to power ratios. Remember that negative dB (“dB down”) would indicate a ratio of less than 1:1. For example, –3 dB means a 1:2 ratio.

–6 dB, +13 dB, –45 dB, –20 dB, +35 dB, +93 dB, +57 dB

 

 

Th 11/5/15
A

No class.

 

 

F 11/6/15

No school (teacher work day).

 

 

M 11/9/15
B

HW due:

1. Read pp. 331-340. Reading notes are required, as always.

2. Write #1-8 on pp. 334-335. Portions of #7 and #8 are done for you below as examples. Also, note that in #6, the problem should be worded as follows:

If each data bit is stored twice for error correction (i.e., 0 becomes 00 and 1 becomes 11), what percentage of all possible 2-bit patterns is invalid? If each data bit is stored three times for error correction (i.e., 0 becomes 000 and 1 becomes 111), what percentage of all possible 3-bit patterns is invalid?

3. Write #1, 4, and 5 on p. 337. For #1, please attempt to use an Algebra II or Precalculus term when answering.

4. Try to decrypt the following sentence, which was encoded using a rotational cipher:

tfqe x yfq lc bccloq xii pqrabkqp zxk plisb olqxqflkxi zfmebop

5. Convert each of the following power levels, and give answers in appropriate units (microwatts, milliwatts, watts, kilowatts, megawatts, gigawatts, or terawatts). Remember that the prefix “m” means “milli,” while “M” means “mega.” We use a capital W to indicate watts.

(a) 3 dB up from 500 mW
(b) 90 dB down from 400 MW
(c) 15 dB up from 60 microwatts
(d) 6 dB down from 160 W

Examples to get you started on the p. 335 problems:

7. 0011 already has an even number of ones, so the 5-bit string would be 00110
    0111 has an odd number of ones, so we need to add a 1 at the end to make even parity: 01111

8. 00101 passes, since it has even parity (an even number of ones)
    01001 also passes, for the same reason
    10101 fails, since it has an odd number of ones (thus a bit error must have occurred somewhere in 10101)

 

 

T 11/10/15
C

HW due: Read pp. 346-353 twice. Reading notes are required, as always. This is difficult material, and you will have to read it slowly. Be sure to do an Internet search for any terms (for example “modulo-N”) that are not familiar to you.

 

 

W 11/11/15
D

HW due: Compute each of the following, showing work (bit by bit). Use your Windows calculator in programmer view to check your answers.

1. 0xABCD and 0x5489

2. 0xFACE xor 0x347A

3. 0xAEB7 or 0x409E

4. ~0xFFAFCBA3

 

 

Th 11/12/15
E

No class.

 

 

F 11/13/15
F

HW due: Last class, we saw how a NOT gate can be constructed out of a NAND gate. All we have to do to invert a signal is to send the signal to both inputs of the NAND gate. If the inputs are 0, their AND is 0 and their NAND is 1. (Success.) If the inputs are 1, their AND is 1 and their NAND is 0. (Success.)

Your first assignment is to build an AND gate out of NAND gates. You can use as many as you wish, but you must use only NANDs: “Nothing but NANDs.” When you are finished, your circuit should accept 2 inputs. If they are both true (binary 1 and binary 1), the output should be 1; in all other cases (01, 10, or 00), the output should be 0.

Your second assignment, which is harder, is to build an OR gate out of NAND gates. This information is widely published on the Internet, but see if you can figure out how to do it on your own. When you are finished, your circuit should accept 2 inputs. If they are both false (binary 0 and binary 0), the output should be 0; in all other cases (01, 10, or 11), the output should be 1.

If you are really ambitious, see if you can code up some of the other gate types using nothing but NANDs. There are 16 different possible gates that accept 2 inputs. The 6 most common ones (AND, OR, NAND, NOR, XOR, and XNOR) are diagrammed, with their truth tables, at this Wikipedia page, but there are 10 others. If you think about it, that makes sense, since the truth table (output) patterns for A and B inputs can be anything from 0000 through 1111 in binary, which is a total of 16 possibilities.

Below are the 16 possibilities, listed in order according to their truth table outputs. Remember, we normally list the possibilities for inputs A and B in the order 11, 10, 01, 00, although that is the reverse of the order used on the Wikipedia page.

 

 

M 11/16/15
G

HW due: Diagram each of the expressions below, #1 through #5, as digital circuit diagrams, using AND, OR, and NOT gates. (Do the best you can; it doesn’t have to be perfect.) Then simplify each expression, showing your work. Your work can include truth tables, algebraic manipulations, or a combination of both. True is denoted by 1, and false is denoted by 0.

Hint: The logical implication,  is equivalent to ~A + B (“A is false or B is true”). Remember also that ~(A · B)  ~A + ~B, as we proved in class, and ~(A + B)  ~A · ~B. The double-headed arrow, , means “is equivalent to,” which is the same as the XNOR gate. If you forget what any of these things mean, you can always look them up on Wikipedia or send an e-mail (double underscore in subject line, please).

1. ~()(~A + B) · 1

2. ( () · () )  ()

3. (A + 0) + (B · 1) + (C · 0)

4. (A · ~B) + (~A · B) + 0

5. ~(A  B) + (A + B + ~A)

 

 

T 11/17/15
A

No class.

 

 

W 11/18/15
B

HW due: Read pp. 359-373. Reading notes are required, as always.

 

 

Th 11/19/15
C

HW due: Read through the key exchange worksheet so that you are familiar with the project that you will be working on in class.

In class: Work on the key exchange worksheet with a partner.

 

 

F 11/20/15
D

In class: Guest speaker, Mr. Joe Morris of MITRE Corporation.

 

 

M 11/23/15
E

No class.

 

 

T 11/24/15
F

FFun Day (no additional written HW due).

 

 

M 11/30/15
G

HW due: Bring a written project proposal (approx. 2 paragraphs). You should choose something MODD-related that is personally of great interest to you. If your topic is approved, you will be given assistance in shaping and fleshing out your project proposal. Target completion date for the final project is Friday, Dec. 18.

 

 

T 12/1/15
A

No class.

 

 

W 12/2/15
B

HW due:

1. Revise your project proposal to incorporate the feedback given in class on Monday. In most cases, that means adding more detail.

2. Read pp. 377-380. Reading notes are required, as always.

In class: Aliasing revisited, beat frequencies, Pythagorean tuning, equal-tempered tuning, tonal vs. atonal music.

 

 

Th 12/3/15
C

No additional HW due. However, an open-notes quiz on recent class discussions is likely.

 

 

F 12/4/15
D

HW due: Read pp. 393-395, 397-401, and the interesting fact at the bottom of p. 403.

 

 

M 12/7/15
E

No class.

 

 

T 12/8/15
F

HW due: Read pp. 410-417. Reading notes are required, as always.

In class: Finalize all project proposals and begin working on projects.

 

 

W 12/9/15
G

HW due: Start working on your project. Our target date for completion is Friday, Dec. 18.

 

 

Th 12/10/15
A

No class.

 

 

F 12/11/15
B

HW due:

1. Finish your 2-page (front and back) excerpt from the 2013 midterm examination. Mark P. has agreed to accept questions to help you get all your answers correct.

2. Work on your project.

 

 

M 12/14/15
C

HW due: Work on your project.

In class: Review for test.

 

 

T 12/15/15
D

HW due: Work on your project.

In class: Review for test.

 

 

W 12/16/15
E

No class.

 

 

Th 12/17/15
F

Test (100 points).

Topic list:
  networking basics (including rates of growth: linear, quadratic, polynomial, exponential, factorial)
  encryption (including derivation of shared secret if instructions are furnished)
  PNG (including execution of algorithm if seed and other parameters are furnished)
  error detection and correction
  compression (lossy and lossless)
  aliasing
  decibels
  symbolic logic and all operations (AND, OR, NOT, XOR, IMP, EQU)
  circuit diagrams (AND, OR, NOT, XOR, NOR, NAND)
  steganography
  digital photography (including terms bpp, resolution, RGB, etc.)
  digital video
  digital audio (including music)
  caching: CPU cache is faster than RAM, RAM is faster than disk, disk is faster than Internet

 

 

F 12/18/15
G

HW due: Submit your project and demonstrate to the class what you did. A short written report (target length: 2 to 3 pages) is also required. Your report should describe what you did, what resources you consulted, and what you learned in the process. The tone can be informal, since this is not a report intended for a larger audience. However, your grammar and spelling should be correct. A PowerPoint slide presentation to supplement your written report is optional.

If you need more time, that is acceptable. (Danny, for example, is still waiting on parts.) In that case, simply give an oral report of what you have accomplished so far.

 

 

M 1/4/16
A

No class.

 

 

T 1/5/16
B

Due date for projects. See instructions in the 12/18 calendar entry.

Optional HW: Take a look at this video of a tiny portion of the Mandelbrot set.

 

 

W 1/6/16
C

No additional HW due.

In class: Final presentation by Danny A., followed by general review for midterm exam.

 

 

Th 1/7/16
D

HW due: Start working on your midterm exam cheat sheet. Bring it to class; as long as you have made a start on the process, you will get credit for this HW assignment. Space limitation is one standard sheet of paper (8.5 by 11 inches), lined or unlined. You may use both sides if you wish. If you wish to reuse your earlier cheat sheet that included nybble, byte, word, dword, qword, etc., then that would count as one of your sides.

 

 

F 1/8/16
E

No class.

 

 

M 1/11/16

Midterm Exam, MH-108, 11:00 a.m. to 1:00 p.m.

A blank copy of the Dec. 17 test is posted here in order to assist you with your studying. A full answer key is also available.

 

 

Links Based on Class Discussions:
-- Latest revision of our MODD course outline from 2005, before we had a good textbook to use
-- Homemade “Segway”-like balancing scooter uses a fair amount of calculus!

Serious Links:
--
STA School Handbook
-- Summer math camps for talented high school students
-- Click here for other serious links


Return to Mr. Hansen’s home page

Return to Mathematics Department home page

Return to St. Albans home page

Last updated: 31 May 2016