Professional Documents
Culture Documents
Javan Smith Activity 4 - Trace and Truth Tables
Javan Smith Activity 4 - Trace and Truth Tables
Class: 4-ARTS
1. Using the following algorithm, complete a copy of the trace table given that X = 4. Note that the first row
has been done for you. (9 marks)
Read X
For M = 1 to X do
Y=X–M
Z=5*Y–M
EndFor
Stop
X M Y Z
4 1 3 14
4 2 2 8
4 3 1 2
4 4 0 -4
2. A room is monitored by a temperature sensor and a smoke sensor. These sensors are connected to
an alarm. If the temperature is too high, the alarm is sounded. If smoke is detected, then the alarm is
sounded.
Suppose:
High temperature or presence of smoke is represented by 1
Normal temperature or no smoke is represented by 0
Sounding the alarm is represented by 1
No alarm is represented by 0
Complete the following table which will determine when to sound the alarm.
1 0 1
1 1 1
0 0 0
0 1 1
(4 marks)