Computer Science 161.01

Test 1 – Fall 2019

Study Guidelines

 

TEXTBOOK READINGS:

 

Chapter One: Sections 1.1-1.3. 

            Read all of it for an overview, concentrate on the Von Neumann model.

            Study also our online notes and practice using any web sites linked therein.

            You will not be tested specifically on sections 1.4 thru 1.7.

 

Chapter Two:  Read only the parts pertaining to integers (not fractions) and also these online notes

and practice any web sites linked therein.

 

Chapter Three: Except for section on Storing Reals.


Chapter Four: Sections 4.1 and 4.3 (addition of twos complement integers).

 

Also, Appendix E.2 page 539, which has a section on the “Half-Adder” Circuit.

 

SKILLS CHECKLIST:

  

            How many binary patterns can be written of length n bits?

            How is textual data represented in binary?

                        You will be given an ASCII chart for the exam.

                        No need to remember any of it.

            How is a color encoded in binary?

                        Know about some simple colors like red, green, blue, white, black.

            Know how to convert binary to hex and hex to binary (think 8-4-2-1).

            Know how to convert binary to octal and octal to binary (think 4-2-1).

            Practice using BinaryAndHex.htm and BinaryAndOctal.htm.

 

            Study our online notes for chapter three and practice using the sites linked therein.

            Know how to convert unsigned decimal integers to and from binary.

            Example using 8 bits:  153 in decimal is 10011001 in binary.

                                                11001010 in binary is 202 in decimal.

           

Know how to convert decimal integers to and from binary using the sign-and-magnitude scheme.

Example using 8 bits:  -36 in decimal is 10100100 in binary.

                                    11001010 is –74 in decimal.

 

Know how to convert decimal integers to and from binary using two’s complement:

Example using 8 bits: -36 in decimal is 11011100 in binary.

(Find the one’s complement representation as before, then add 1).

Going the other direction, 11001010 is the two’s complement representation of a negative number.  To see which, invert and add 1, getting 00110110.  So 11001010 must be the two’s complement representation for –54.

           

            What range of numbers can be represented in 8 bits Two’s Complement?

 

            Practice all of these type problems using the BinaryToDecimal.htm web site.

 

 

 

Arithmetic and Logical Operations on Bits

 

            Study our online notes and any web sites linked therein.

            Arithmetic:

            Given two decimal integers, add them as 8-bit two’s complement numbers.

            Example:  64 + -54

                                                01000000

                                       +       11001010 (from previous page)

                                                ------------

                                                00001010 (is this correct?)

            Another example:

                        Make an example up that will result in “overflow”.

                        What (wrong) answer results?

 

            Logical:

            Know how each of the operators NOT, AND, OR, and XOR work.

            Study some of the applications described on pages 80-83 and demonstrated by our C++ programs.

            Know how to work with hex operands as you did on most recent homework.

 

            Example:  NOT x8F = NOT 10001111 = 01110000 = x70.

 

            Examples: x73 AND x99:

                                    01110011

                        AND   10011001

                                    -----------

                                    00010001    The answer is x11.

 

            For practice do  x73 OR x99 and then x73 XOR x99.

            Should get xFB and then xEA.   Hopefully you do.

 

 

 

Applications of Logic to Circuit design:  Be able to derive a truth table for a  logical expression such as  (NOT A) AND (B OR  C)   and be able to draw a circuit with inputs (labeled A, B, C in this example)  and one output (labeled OUTPUT) whose behavior is exactly that represented by the truth table.  

For example:

A         B         C             OUTPUT

0          0          0                      0

0          0          1                      1

0          1          0                      ?

0          1          1                      ?

1          0          0                      ?

1          0          1                      ?

1          1          0                      ?

1          1          1                      ?

 

 

 

The Very Basics of the VSC-32 machine:   Know how many memory addresses there are (that’s easy!).   If I gave you an 8-bit instruction, would you be able to tell me how to interpret what it means?    If I gave you a very short program (either in binary or in hex), could you tell me what it does?    You will be given the 8 different “opcodes”.