Elizabeth Glen

CSC103 How Computers Work
Assignment 1

Due Thursday 17 Sep 09 (by midnight)

Submitted by Elizabeth Glen, working with Gabriela Acosta

[Converted from her Word doc to HTML, with attendant quirks not in the original.]

 

Last Update: Tue, 15 Sep 2009 14:34:47 GMT

Please read Assignment and Quiz Rules first!

 

Take Moodle Quiz1 by midnight Thursday 17 Sep 09.

 

      1.) There is a difference between software running in user mode or in kernel mode, as mentioned in Notes1 (in the OS table and under Process Management). Other terms for these modes are: user mode = protected mode, kernel mode = supervisor mode. What do you think are the advantages and disadvantages of a device driver running in one mode versus running in the other mode?

 

         The advantage to using a device driver in user-mode is that it has improved stability because a poorly written device driver in user mode canÕt overwrite kernel memory and crash the system. The disadvantage to using user-mode for a device driver is that making the transition from user-mode to kernel-mode imposes a great deal of performance overhead, and it prohibits user-mode driversÕ requirements for low latency and high throughput.

 

         Site: Wikipedia ÒDevice driverÓ

         http://en.wikipedia.org/wiki/Device_driver#Kernel-mode_vs_user-mode

       

      2.) Compare Z3 to Eniac: How were they essentially the same? How were they essentially different? List what seem to be the key aspects.

 

         Differences:

 

1.)   The Z3 uses the Binary numeral system and the ENIAC uses the Decimal system.

2.)   The Z3 is electro-mechanical and the ENIAC is electronic.

3.)   The Z3 is program-controlled by punched film stock (but no conditional branch) and the ENIAC is program-controlled by patch cables and switches.

 

         Similarities:

 

1.)   The Z3 and the ENIAC are both Turing complete.

2.)   The Z3 and the ENIAC are both examples of early digital computers of the 1940Õs.

3.)   Both the Z3 and the ENIAC are program-controlled.

 

Site: Wikipedia – ÒZ3 (computer)Ó http://en.wikipedia.org/wiki/Z3_(computer)

 

 

      3.) Perform these two additions in binary:

                        10011 + 10001 = 100100

 

                  1  0  0  1 1                            1  0  0  0  1

              x 16  8  4  2  1                      x 16 8  4  2  1

                 16  0  0  2  1 = 19                 16 0  0  0  1 = 17

 

                                             19+17 = 36

 

36/2 = 18 R 0            4/2 = 2 R 0

18/2 = 9 R 0              2/2 = 1 R 0                    =      100100

 9/2 = 4 R 1               1/2 = 0 R 1

 

 

 

                        11011 + 00101 = 100000

 

                  1  1  0  1  1                           0  0  1  0  1

              x 16 8  4  2  1                               x 16  8  4  2  1

                 16 8  0  2  1 = 27                  0   0  4  0  1 = 5

 

                                             27+5 = 32

 

32/2 = 16 R 0                       4/2 = 2 R 0

16/2 = 8 R 0                         2/2 = 1 R 0                  = 100000

  8/2 = 4 R 0                         1/2 = 0 R 1

       

      4.) Perform these two subtractions in binary:

                        10011 - 10001 = 10

 

                  19 – 17 = 2

 

2/2 = 1 R 0         =  10

1/2 = 0 R 1

 

                        11011 - 00101 = 10110

 

                  27 – 5 = 22

 

22/2 = 11 R 0              2/2 = 1 R 0

11/2 = 5 R 1                1/2 = 0 R 1                  =  10110

  5/2 = 2 R 1

 

      Although I did not cover subtraction in class, you should be able to figure out the answers one way or the other.

       

      5.) What are the first twenty numbers when written out in base-5 representation? 
We did not cover base 5 in class, but the principles are the same for all bases.

 

      I did this for each number to get my answer:

 

            18/5 = 5 R 3    18 = 33

              3/5 = 0 R 3

 

First 20 #Õs (1-20) : 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 30, 31, 32, 33, 34, 40.