Lecture 8: Design and Specification Flashcards
What is functional specification?
It is used to describe the relationship between the inputs and outputs of a system.
What is top down design?
We start with a very abstract design of the system and identify the major components. It is stepwise refinement with an iterative process for decomposition as it will refine the system into smaller more manageable components
What is bottom up design?
Start with the small basic level components. Use these smaller components to build up to more complex functionality.
Why would we want to use Top Down design?
It helps us to clarify the problem and gain a system level perspective of the design. We can easily distribute module implementation.
What is bad about Top Down design
It can be hard to test early on because we may not have created some of the required components yet. Get around this by creating stub models.
What is good about Bottom Up design?
It is fast to implement and allows for early testing. We can build and test the critical modules first.
What is bad about Bottom Up design?
It is hard to gauge an overall idea of system functionality, as we need all modules to observe this. We may get into the project and then find out that redesign is needed.
What is a system context diagram?
It is a diagram that shows the boundary between a system and its environment. It will detail all external entities that may interact with the system. It is the top most level of design.
Represent the system in a circle and all other peripherals in rectangles.
What can we do to refine a system context diagram?
Use a Dataflow diagram.
What is a data flow diagram?
It is a diagram that can show either physical or logical data flow. It is hierarchal meaning that it can show different levels of the system.
What is a Finite State Machine?
We use it to model and control sequencing in a system. it is a visual representation that can be useful when implementing real time systems. The outputs of the system not only depend on the input to the system but also the previous state of the system.
What is a Mealy State Machine?
It is a model where the output depends on the input and the current state. It will have less states compared to the Moore Machine. It will respond faster, with the output reacting to a change without delay.
What can happen to a Mealy State machine if we aren’t careful when connecting two state machines?
Can cause asynchronous feedback.
What is a Moore State Machine?
The output only depends on the current state of the machine.
Why is a Moore machine safer?
There is a delay on its outputs. The outputs can only change once the state is reached.
By default, do Finite state Machines support value only events?
NO. We can extend FSM’s to be able to deal with these.
How can we create a FSM in C?
By using a switch case statement. The state is the current case. Transitions are the assignment to state variable. Events and conditions are if else statements. Actions are assign statements.
What is hierarchal FSM?
These allows states to encompass other states and can allow for a more compact representation in some cases.
How does Hierarchal FSM allow for a more compact representation?
Because FSM needs to be overly specific, it reduces the need for duplicate states
How can we create a Hierarchal FSM in C?
By using nested switch case statements.