CS 224, Su2016 Homework #2 S02: Digital Logic Name Questions: A = 0101 0110 B = 0111 0000 NOT A A OR B A AND B A NOR B A NAND B A XOR B A AND B OR NOT A 2. (8 points) Using the A and B values above as 2’s complement numbers, compute the following 8-bit arithmetic operations : a. b. c. d. Please initial to permit public return (FERPA) Score /71 Answers: 1. (7 points) Compute the following bitwise logical operations given the values of A and B? a. b. c. d. e. f. g. Section NEG A A ADD B A SUB B A SUB B ADD NEG B a. b. c. d. e. f. g. a. b. c. d. 3. (8 points) Program the following equation into the Programmable Logic Array (PLA) to the right by filling in (marking) the appropriate question mark boxes to make wire connections. (The symbol is an exclusive OR, left to right associativity.) Z=ABC 4. (9 points) A milling machine has two switches, either one will turn the machine on/off. (The machine will not operate with both switches on.) Switch S1 is on the side of the machine and switch S2 is on the floor. In addition, the machine has two cut-off microswitches, switch M1 is on a guard surrounding the milling tool and the second switch M2 is on the access door to the internal mechanism of the milling machine. For safety reasons, both microswitches must be closed (logic ‘1’) before the machine can operate. Using AND’s, OR’s, and NOT’s, a) write an equation and b) draw a logic circuit for this machine. BYU, CS 224, Su2016 Homework #2 Page 1/2 5. (10 points) Complete the timing relationship for the following master-slave flip-flop. (Assume the flip-flop is in the clear state prior to the occurrence of the clock pulse.) C D Y Y Q Q' 6. (9 points) Fill in the blank entries of the state table to the right for the state diagram below. The Boolean value below the state names 0¢, 5¢, 10¢, and 15¢ is the current output Z. Next State Current State Output Z N 0¢ 0 5¢ D 5¢ 10¢ 15¢ 7. Consider the following simple microwave controls: 10¢ a. State Diagram: TEMP, START/STOP, and RESET are buttons whose input values are 0 (normal) and 1 (pressed). and are output display lights that are either on (1) and off (0). The TEMP button cycles from no temperature setting ( and off), to low temperature ( on off), to high temperature ( off on), and then toggles between high and low thereafter (if not running). The START/STOP button turns the microwave on and off (if a temperature has been selected.) The RESET turns the microwave off and clears any temperature setting. a. (10 points) Using the symbols T for TEMP, S for START/STOP, and R for RESET, create a finite state diagram for the operation of the microwave. (Ignore impossible states and simultaneous pressing of buttons.) b. (10 points) Using the above symbols plus “s3” for microware off/on, “s2” for off/on, and “s1” for off/on, fill in the truth table of the finite state machine for the operation of the microwave (5 states, 4 actions/rows per state). BYU, CS 224, Su2016 b. Truth Table: T 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 Input S 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 R 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 Homework #2 Current State s3 s2 s1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 1 0 1 0 0 1 0 0 1 0 1 0 1 1 0 1 1 0 1 1 1 0 1 1 0 1 1 0 Next State s3' s2' s1' 0 0 0 0 0 0 0 0 1 Behavior of Current State Idle Page 2/2
© Copyright 2026 Paperzz