CS 270: Exam 1

Ace your homework & exams now with Quizwiz!

What operator symbol in C performs a logical NOT

!

The beginning character of a preprocessor directive is a/an

# (pound sign)

The following binary number uses a 14-bit 2's complement convention to represent a signed integer 0b11 1111 1101 1011

-37

A sequential circuit is described by the state table(A4) If the initial state is 0,0, what will be the output values if successive inputs values are 0,1,0.

001

What is the 8-bit binary representation of the unsigned decimal value 67

01000011

Add the following two binary numbers. The answer must have 6 bits (discard the last carry if any) 0b010011 0b111110

010001

What is the 8-bit binary representation of the unsigned decimal value 90

01011010

Add the following two binary numbers. The answer must have 6 bits (discard the last carry if any). 0b110101 0b100111

011100

1 | main() 2 | { 3 | int w = 1; 4 | int x = 6; 5 | int y = 5; 6 | int z = 0; 7 | 8 | z = !z || !x && !y; 9 | z = x-- == y + 1; 10| z = (x / y++) * z + (x % w); 11| z = (x++ < (--y + w)) ? 10 : z; 12| z += z; 13| } After line 10 is executed, z will equal

1

1 | main() 2 | { 3 | int w = 1; 4 | int x = 6; 5 | int y = 5; 6 | int z = 0; 7 | 8 | z = !z || !x && !y; 9 | z = x-- == y + 1; 10| z = (x / y++) * z + (x % w); 11| z = (x++ < (--y + w)) ? 10 : z; 12| z += z; 13| } After line 8 is executed, z will equal

1

1 | main() 2 | { 3 | int w = 1; 4 | int x = 6; 5 | int y = 5; 6 | int z = 0; 7 | 8 | z = !z || !x && !y; 9 | z = x-- == y + 1; 10| z = (x / y++) * z + (x % w); 11| z = (x++ < (--y + w)) ? 10 : z; 12| z += z; 13| } After line 9 is executed, z will equal

1

A C program has at least how many functions

1

A not gate is implemented with what?(transistors)

1 p-type and 1 n-type MOS transistors

A not gate is implemented with what?

1 p-type and 1 n-type MOS transistors.

1 | main() 2 | { 3 | int w = 1; 4 | int x = 6; 5 | int y = 5; 6 | int z = 0; 7 | 8 | z = !z || !x && !y; 9 | z = x-- == y + 1; 10| z = (x / y++) * z + (x % w); 11| z = (x++ < (--y + w)) ? 10 : z; 12| z += z; 13| } After line 12 is executed, w will equal _ and x will equal _

1, 6

1 | main() 2 | { 3 | int w = 1; 4 | int x = 6; 5 | int y = 5; 6 | int z = 0; 7 | 8 | z = !z || !x && !y; 9 | z = x-- == y + 1; 10| z = (x / y++) * z + (x % w); 11| z = (x++ < (--y + w)) ? 10 : z; 12| z += z; 13| } After line 11 is executed, z will equal

10

A cell phone company owns 701 towers. If the company's engineers wanted to assign a unique bit pattern to each tower, what is the minimum number of bits they will need to represent all 701 towers

10

What is the result of performing the following bitwise operations using 8 bits? Show the result in binary. (0b11001001) AND (0b11100010 OR 0b01010010) = 0b

11000000

What is the hexadecimal equivalent of the binary number 0b1110110101000?

1DA8

Use decimal numbers in your answer, i.e. 4. There are n-type _ transistors and p-type _ transistors in a NAND gate

2, 2

Use decimal numbers in your answer. There are _ n-type transistors and _ p-type transistors in a two input NAND gate

2, 2

Convert the unsigned decimal integer 127 to base 7

241

A combination circuit has inputs A,B,C and D. It should implement the function F = AB+CD+A'CD. We want a 2-level implementation using AND and OR gates. How many AND and OR gates do we need, assuming the circuit is implemented directly as specified without any minimization? (NOT Gates are needed, but not counted)

3 AND gates and 1 OR gate

A state machines has 8 states. How many flip-flops it will need to implement?

3 flipflops, because 2^3=8

What is the value of x after the following C statement int x = 5 < 2 ? 7 : 42;

42

Convert 4A1 which is in base 11 (unsigned integer) to a decimal number

595

0xA20 ^ 0xD84 = (show exactly 3 hexadecimal digits)

7A4

A synchronous sequential circuit has 3 flipflops. What is the maximum number of states it can implement?

8 states, because 2^3=8

0xA20 & 0xD84 = (show exactly 3 hexadecimal digits)

800

What is the hexadecimal representation of the binary number 0b100111011010

9DA

A sequential circuit has two flip-flops with inputs DA and DB. The flip flop with the input DA has the output A which takes on DA's value in the next clock cycle, the flip flop associated with DB works similarly. The combinational logic is described by the equationsDA = AB' + AX' + A'BXDB = B'X + BX'If present state is A,B = 0,0, and if input x is 1, the next state will be(you need pencil and paper for this)

A,B = 0,1

At any time there are exactly ______ transistors in a open state in a 2 input AND gate.

ASK TA

Use a decimal number to fill in the blank. A 16 input mux has _____ select lines

ASK TA

We have a PLA with inputs A,B,C and outputs D,E,F described by this truth table:(A2) If we minimize this PLA table, how many product terms we will finally have?

ASK TA

We want to design a sequential circuit described by the state table(A5) We use two flip-flips with inputs DA and DB, which correspond to Next St A and B in the truth table. Then the minimal implementation for DA is? (Use boolean algebra or a karnaugh map to find the minimal implementation)

DA = AX + BX

0xA20 | 0xD84 = (show exactly 3 hexadecimal digits)

FA4

A short int always declares an integer that has one half the number of bits of a regular int(T or F)

False

Every line of a C program should end with a semicolon(T or F)

False

P is false Q is true What is the value of the expression P and (Q and not Q)

False

P is true What is the value of the expression P and not P

False

When trying to learn new material research shows that passive techniques such as rereading, or highlighting tend to produce better results than spaced and interleaved study using techniques such as quizzes, retrieval or reflection(T or F)

False

An algorithm is a step-by-step procedure, characterized by

Finiteness, Effective Computability, Definiteness

Addressing modes and data types are elements of the

ISA

What is the range of signed integers you can represent with 10 bits using two's complement

Min: -512 Max: 511

What is the range of unsigned integers you can represent using 9 bits

Min: 0 Max: 511

Is the following number positive or negative (assuming it has been represented using the two's complement convention in 7 bits). 0b1010010

Negative

If the 2 inputs of a 2 input nand gate are connected together, then the function of the nand gate is that of a?

Not gate

A R-S latch is cleared by setting the (blank) signal to (blank)

R, 0

A Full Adder has inputs Ai=1, Bi=1, and carry-in Ci=1. What would be the sum bit Si and the carry-out bit Cout?

Si=1, Cout=1

For a logic circuit to work as a storage element the output of the circuit must be fed back to the input(T or F)

True

Instead of spending time rereading or reviewing material the reading assignments suggest that time would be better spent taking a low stakes quiz over the material(T or F)

True

It is possible to have a register that only stores 1 bit

True

P is false What is the value of the expression P or not P

True

P is true Q is false What is the value of the expression P and (Q or not Q)

True

The C statement scanf("%d", &time); reads in an entity, treats it as a decimal number, and stores the decimal number in variable time(T or F)

True

A gated D latch can only be written to when the _____ signal is asserted.

WE

What operation does the ^ symbol perform in C

XOR

It is likely that a program written in [1] language for one ISA will also run on a computer having a different ISA.

a high level

Obtain the minimized boolean expression for this combinational function F(a,b,c,d) using a Karnaugh map.The function is 1 for these input combinations:a,b,c,d = 0000, 0010, 0110, 1000, 1010

b'd' + a'cd'

Obtain the minimized boolean expression for this combinational function F(a,b,c,d) using a Karnaugh map.The function is 1 for these input combinations:a,b,c,d = 0000, 0010, 0110, 1000, 1010.

b'd' + a'cd'

A D flip-flop stores one bit of information. For a rising-edge triggered D flipflop, the current output is 1. If the input changes to a 0 and next rising edge arrives, the output will soon

change to 0

Which of the following is a value that can be change during the execution of the program? #define CHARGE_2 5 #define RADIUS 3 const float epsilon = 8.854E-19; main() { float k = 0; float charge_1 = 2.0; float force; k = 1 / (4 * 3.14159 * epsilon); force = (k * charge_1 * CHARGE_2) / (RADIUS * RADIUS); printf("The Coulomb force is: %f\n", force); }

charge_1

A _________ is helpful in identifying the opcode of an instruction

decoder

Which circuit has N inputs and up to 2^N outputs. This circuit also has the property that given any combination of values as input, only one of the circuits outputs will have the value 1

decoder

Which circuit has the property that only one of its outputs is guaranteed to be1?

decoder

Some computers can do things (blank) but none can do more than any other

faster

Digital machines calculate by (blank) and have the advantage (blank)

manipulating a fixed, finite set of digits accuracy can be increased by increasing the number of digits used for calculation

A 1 bit adder has ________ gates than a 1 bit multiplier. (Hint build the truth tables for each device)

more

To keep track of data used within a C program, the compiler needs all the following information EXCEPT

the variable's initial value

A 2-to-4 decoder has two inputs A and B and outputs W, X, Y, Z. When A=1, B=0, Y is selected. When is W selected?(A1)

when A=0, B=0

A decoder has two inputs A and B and outputs D0, D1, D2, D3. When A=0, B=0, D0 is selected. When is D3 selected?

when A=1, B=1

A decoder has two inputs A and B and outputs W, X, Y, Z. When A=0, B=0, W is selected. When is Z selected?(A3)

when A=1, B=1

We say that a set of gates is logically complete if we can build any circuit without using any other kind of gates. Which of the following sets are logically complete? FYI these sets are also logically complete: {AND, NOT}, {NOR}, {NAND}

{AND,OR,NOT}

What operator symbol in C performs a bit-wise NOT

~


Related study sets

Chapter 17 - Retailing and Omnichannel Marketing (Smartbook)

View Set

Systematic Innovation: Week 1 Material

View Set

Principles of Advertising (JMC 348) Connect Assignments

View Set