码迷,mamicode.com
首页 > 其他好文 > 详细

CSYE 7374: IoT Embedded System

时间:2020-02-08 19:36:44      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:pos   put   either   exe   this   sub   opp   argument   system   


CSYE 7374: IoT Embedded Systems
Assignment 2
Due on 2/5/20
1) Given the following C update function, what does the FSM look like ? Assume push and
pop are input pure signals and the return value of the function is a pure output signal called
output. In addition write down the description of this FSM as a 5-tuple.
typedef enum
{
STATE_A = 0,
STATE_B,
STATE_C,
STATE_D
} state_t;
typedef enum
{
PRESENT = 0,
ABSENT
} signal_t;
signal_t update(state_t *state, signal_t push, signal_t pop)
{
if (push == PRESENT && pop == ABSENT && *state < STATE_D)
{
if (*state == STATE_A)
{
*state = STATE_B;
}
else if (*state == STATE_B)
{
*state = STATE_C;
}
else if (*state == STATE_C)
{
*state = STATE_D;
}
return PRESENT;
}
else if (*state == STATE_D && push == ABSENT && pop == PRESENT)
{
*state = STATE_A;
return PRESENT;
}
return ABSENT;
}
2) Given:
1
Formally write down the description of this FSM as a 5-tuple:
(States,Inputs, Outputs, update, initialState)
Then write a C update that describes the FSM. Note that the function will have two outputs
and a single input. This is exactly the opposite to the FSM shown in the previous exercise
(two inputs and one output).
3) Given:
Is this true or false ? Give supporting argument:
“The output will eventually be a constant 0, or it will eventually be a constant 1. That
is, for some n ∈ N, after the n
th reaction, either the output will be 0 in every subsequent
reaction, or it will be 1 in every subsequent reaction.”
如有需要,请加QQ:99515681 或邮箱:99515681@qq.com 微信:codehelp

CSYE 7374: IoT Embedded System

标签:pos   put   either   exe   this   sub   opp   argument   system   

原文地址:https://www.cnblogs.com/lyapyth/p/12284176.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!