prelim1-19fa

.pdf

School

Cornell University *

*We aren’t endorsed by this school

Course

3410

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

10

Uploaded by MinisterGalaxy9309

Report
Fall 2019 CS 3410 Prelim 1 Please turn off and stow away all electronic devices. You may not use them for any reason during the exam. Do not bring them with you if you leave the room temporarily. This is a closed book and notes examination. You may use the 3-sided reference sheet at the back of the exam. You may use the 4th side as scratch paper. There are 8 problems . Make sure you have the whole exam. You have 90 minutes to complete 90 points. Use your time accordingly. Question Points Score 1 4 2 7 3 9 4 16 5 20 6 10 7 12 8 12 Total: 90 It is a violation of the Academic Integrity Code to look at any exam other than your own, to look at any other reference material, or to otherwise give or receive unauthorized help. We also ask that you not discuss the exam with anyone who has not yet taken it. Academic Integrity is expected of all students of Cornell University at all times, whether in the presence or absence of members of the faculty. Understanding this, I declare I shall not give, use or receive unauthorized aid in this examination. Signature: Date Name: NetID
1. [4 points] A rolling stone gathers no CMOS. Recall that a p-transistor connects source to drain when a negative/zero charge is applied to the gate. What function does the following CMOS diagram implement? Your Answer: ground V supply A B C OUT D E A B ground C ground E D 2. 01 is the lonelist number. (a) [2 points] Express the unsigned binary number 100100101 in unsigned octal (base 8). Your Answer: (b) [2 points] Express the 2s complement number 100100101 in decimal (base 10). Your Answer: (c) [3 points] Fractional Binary Encoding is a binary encoding with a decimal point. The columns to the right of the decimal point continue in the pattern of decreasing powers of 2: the column immediately to the right of the point is the 2 - 1 ( = 1 / 2) column, next to that is the 2 - 2 ( = 1 / 4) column, and so on. Given your understanding of two’s complement, what is the value of the 6-bit two’s complement fractional binary number 101.010 ? Your answer must be expressed as a single number. Your Answer: Page 2
3. [9 points] Universal Gatecare? A NAND gate is called a universal gate because you can build all other logic gates using only NAND gates. Each circuit below is a logical gate built exclusively out of NAND gates. What is the gate functionality of each circuit? Your Choices are: A. NOT B. AND C. NAND D. OR E. NOR F. XOR G. XNOR H. None of these Note: many circuits show a single input ( a or b ) sent to both inputs of the same NAND gate. a b Q Your Answer: a Q Your Answer: a b Q Your Answer: Page 3
4. Sign of the Times Adds . Recall that the leftmost bit of a sign magnitude number indicates positive (0) or negative (1). Recall also that sign magnitude addition requires some unique manipulations. Your task is to perform these manipulations. Given two 5-bit sign magnitude numbers, X and Y, add them together, using an AddSub subcircuit (that calculates A + B when op=0 , and A - B when op=1 ). You may use standard 2-input logic gates, muxes, and a comparator (shown on the first page of the reference sheet). Approach: If the signs of the two inputs match, add the inputs as unsigned numbers. If they differ, subtract the smaller magnitude from the larger; keep the sign of the larger. Do not worry about overflow or the B input. (a) [4 points] Draw a circuit that assigns (1) op to the AddSub subcircuit. X Y 5 5 X[4] Y[3-0] Y[4] X[3-0] op 1 skip skip Z[4] skip AddSub Z[3-0] 4 A 4 B Page 4
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help