A turnstile at a sports stadium is modelled as a finite-state machine (FSM). It has two states: L (locked) and U (unlocked). A visitor can present a valid c...

Assessment: Computer Science 4CP0 | Paper 1 Mock 01 | Written Paper 1 Subject: Computer Science - 4CP0

Question 1 Report

A turnstile at a sports stadium is modelled as a finite-state machine (FSM). It has two states: L (locked) and U (unlocked). A visitor can present a valid card, represented by input C, or try to push through, represented by input P. The turnstile output is either OPEN or CLOSED. The machine begins in state L. A valid card unlocks the turnstile. Once unlocked, another valid card leaves it unlocked; a push causes it to lock again.

LUC / OPENP / CLOSEDP / CLOSEDC / OPENstart© EAGLE BEACON GLOBAL

The state code for L is 00. Complete the questions using the diagram and transition table.

Current stateInputNext stateOutput
LCUOPEN
LP??
UC??
UPLCLOSED

(a) State the two possible input symbols. [2]
(b) Identify the start state. [1]
(c) Complete the two incomplete rows of the transition table. [2]
(d) Complete the two-bit state code: U = __. [1]
(e) Convert the binary code for U into denary. [1]
(f) Give one suitable physical device that could detect a visitor pushing through the turnstile. [1]
(g) State the next state when the current state is U and the input is C. [1]
(h) Explain why an FSM is suitable for modelling this turnstile. [3]

Answer Details

(a) The input symbols are C and P [2].

(b) The start state is L, the locked state [1].

(c)

Current stateInputNext stateOutput
LPLCLOSED
UCUOPEN

A push while locked leaves it locked; a valid card while unlocked leaves it unlocked [2].

(d) The other two-bit state code is U = 01 [1].

(e) \(01_2=\textbf{1}\) in denary [1].

(f) An infrared beam sensor could detect a visitor pushing through [1].

(g) From U with input C, the next state is U [1].

(h) The turnstile has a small finite set of clearly defined states: locked and unlocked. Its next state and output depend on the current state and current input. Therefore states and transitions represent all its possible behaviour [3].

Download The App On Google Playstore

Everything you need to excel in your exams

Green Bridge CBT Mobile App
Personalized AI Learning Chat Assistant
200,000+ Exam Questions Across IGCSE, JAMB, WAEC & NECO
Over 3,900 Lesson Notes
Offline Support - Learn Anytime, Anywhere
Green Bridge Timetable
Literature Summaries & Potential Questions
Track Your Performance & Progress
In-depth Explanations for Comprehensive Learning