Page 236 - 《软件学报》2021年第6期
P. 236
1810 Journal of Software 软件学报 Vol.32, No.6, June 2021
while (every_i≤5)
{counter_count[every_i]:=TEMP%2;
every_i:=every_i+1;
TEMP:=TEMP/2}}
else {
if (reg_counter_count<60)
then {reg_counter_count:=reg_counter_count+1;
TEMP<==reg_counter_count and skip;
every_i:=0;
while (every_i≤5)
{counter_count[every_i]:=TEMP%2;
every_i:=every_i+1;
TEMP:=TEMP/2}}
else {reg_counter_count:=1;
TEMP<==reg_counter_count and skip;
every_i:=0;
while (every_i≤5)
{counter_count[every_i]:=TEMP%2;
every_i:=every_i+1;
TEMP:=TEMP/2}}}}
else {empty};
counter_counter_count:=reg_counter_count;
Old_counter_clk_temp:=counter_clk;
Old_counter_rst_temp:=counter_rst};
function signal_light(int signal_light_clk,intsignal_light_rst,intreg_signal_light_count)
{frame(signal_light_count) and (
int signal_light_count[6] and skip;
TEMP<==reg_signal_light_count and skip;
every_i:=0;
while (every_i≤5)
{signal_light_count[every_i]:=TEMP%2;
every_i:=every_i+1;
TEMP:=TEMP/2};
if (signal_light_clk=Old_signal_light_clk+1)
then {if (signal_light_rst≤0)
then {reg_signal_light_state:=signal_light_Idle;
TEMP<==reg_signal_light_state and skip;
every_i:=0;
while (every_i≤2)
{signal_light_state[every_i]:=TEMP%2;
every_i:=every_i+1;
TEMP:=TEMP/2};