1.1.1 Binary systems Chapter: 1.1 Data representation EXAMPLE#2: SENSORS IN PRINTING DEVICES: sensors are attached to a printing device, with three alarms attached to the sensors. The first sensor, "A," detects if the device needs ink. The second sensor, "B," detects if the device needs repair. The third sensor, "C," detects if the device has jammed paper. If the device jams or needs repair, alarm 1 sound. If the device jams or is short on ink, alarm 2 sounds. If two or more problems occur at once, alarm 3 sounds.It can now be implied that: A=1 refers to ink” “low B=1 refers to needs repair” “Device C=1 refers to should jam” “device The outputs to the system are as follows: A1: 1 sounds if B=1 or C=1(either of B=1 or C=1 will result in A1) A2: Alarm 2 sounds if C=1 or A=1 (either of A or C being true will result in A2) A3= any two or more of A, B, and C being will result in A3. ‘1’ Let us now look at the cases that will form: Questions: 1) What binary values can the register hold to alert the user of a ink” situation? “low 2) The register is holding Which alarm will sound? “010”. 3) Is the system accurate in telling the user of exactly which problem is being occurred? Point out any one situation where user is misguided? Answers: 1) 010, 111, 111, 111 2) A2 will sound. 3) No. System has the same alarm for one problem or more than one problem. E.g. 111 could mean that all three problems have occurred but 111 can be received even if printer is on ink” or not having “full paper.” “jammed Binary system PSEPS PSEPSEUDOCODE EXAMPLES WITH SOLUTIONS
1.1.1 Binary systems Chapter: 1.1 Data representation EXAMPLE#2: SENSORS IN PRINTING DEVICES: sensors are attached to a printing device, with three alarms attached to the sensors. The first sensor, "A," detects if the device needs ink. The second sensor, "B," detects if the device needs repair. The third sensor, "C," detects if the device has jammed paper. If the device jams or needs repair, alarm 1 sound. If the device jams or is short on ink, alarm 2 sounds. If two or more problems occur at once, alarm 3 sounds.It can now be implied that: A=1 refers to “low ink” B=1 refers to “Device needs repair” C=1 refers to “device should jam” The outputs to the system are as follows: A1: 1 sounds if B=1 or C=1(either of B=1 or C=1 will result in A1) A2: Alarm 2 sounds if C=1 or A=1 (either of A or C being true will result in A2) A3= any two or more of A, B, and C being ‘1’ will result in A3. Let us now look at the cases that will form: Questions: 1) What binary values can the register hold to alert the user of a “low ink” situation? 2) The register is holding “010”. Which alarm will sound? 3) Is the system accurate in telling the user of exactly which problem is being occurred? Point out any one situation where user is misguided? Answers: 1) 010, 111, 111, 111 2) A2 will sound. 3) No. System has the same alarm for one problem or more than one problem. E.g. 111 could mean that all three problems have occurred but 111 can be received even if printer is “full on ink” or not having “jammed paper.” Binary system PSEPS PSEPSEUDOCODE EXAMPLES WITH SOLUTIONS
basic-programing.docx