中午1点是什么时辰| 宝宝病毒性感冒吃什么药效果好| 非虫念什么| 空调为什么要加氟| 治疗神经痛用什么药最有效| 腾冲有什么好玩的景点| 咖啡配什么好喝| 长智齿牙龈肿痛吃什么药| 假花放在家里有什么忌讳| 4.29是什么星座| 健身前吃什么比较好| 红痣是什么原因引起的| 龋齿和蛀牙有什么区别| 酸梅是什么水果| 哺乳期感冒能吃什么药| 黄精能治什么病| 轴位是什么| 扬州有什么好玩的地方| 欧多桑是什么意思| 颈动脉斑块是什么意思| 急性肠胃炎吃什么药| 蓉字五行属什么| 宫颈活检cin1级是什么意思| 雄激素过高是什么意思| 长痱子是什么原因| 月经不调吃什么药效果好| 男的叫少爷女的叫什么| 脚软没力气是什么原因引起的| 脚气是什么| 割包皮有什么影响| 大腿外侧麻木是什么原因| 弟弟的女儿叫什么| 类风湿和风湿有什么区别| 蜈蚣吃什么| zara是什么意思| 区长什么级别| 脚肿是什么原因造成的| 牛剖层皮革是什么意思| 宠物蛇吃什么| 哑巴是什么原因造成的| 湿气太重吃什么药| 喝红酒对身体有什么好处| 路亚竿什么品牌好| 霉菌性阴炎用什么药好得快| 风湿因子高是什么原因引起的| 产妇喝什么汤下奶最快最多| 爱因斯坦发明了什么| galaxy是什么牌子| 什么是正方形| 大米含有什么营养成分| 羟苯乙酯是什么东西| 鸟加衣念什么| 肠道细菌感染吃什么药| 低密度脂蛋白胆固醇高是什么意思| 粉尘螨是什么东西| 什么鱼适合红烧| 包粽子的叶子叫什么| 炁怎么读什么意思| 疼痛科属于什么科| 淋是什么意思| 硬盘是什么| 6月26日是什么日子| 什么食物对肝有好处| 自我是什么意思| pdrn是什么| 基因突变发生在什么时期| 5月28日是什么星座| 半联动是什么意思| 北京市副市长什么级别| 打下巴用什么玻尿酸最好| 无能为力是什么意思| 力挺是什么意思| 男命食神代表什么| 甲级战犯是什么意思| 胸部ct平扫能检查出什么| 带资进组什么意思| 胎囊是什么| cap医学上是什么意思| in77是什么意思| 屁股沟疼是什么原因| 孩子吃什么能长高| 头孢加酒有什么反应| 贾乃亮演过什么电视剧| 丁克什么意思| nt什么意思| 子宫内膜息肉样增生是什么意思| 闪失是什么意思| 护理是干什么的| 还俗是什么意思| 夏天适合用什么护肤品| 1998年属什么生肖| 姑奶奶是什么意思| 故事是什么意思| 被虫子咬了涂什么药膏| 睡觉做梦多是什么原因| 倒灌是什么意思| 脚趾缝痒溃烂用什么药| 挖坑是什么意思| 痛风挂号什么科| 盐酸二甲双胍缓释片什么时候吃| salsa什么意思| 杰士邦是什么| 洺字五行属什么| 伤口结痂为什么会痒| 拖是什么意思| 切勿是什么意思| 梦见小蛇是什么意思| 830是什么意思| 车厘子是什么| 乘的部首是什么| 出佛身血是什么意思| 农历五月十八是什么日子| 女人腿肿应该检查什么| 不景气是什么意思| 什么情况下会缺钾| 培根是什么肉| 为什么腿老是抽筋| 釉是什么| 头发偏黄是什么原因| 大姨妈量少什么原因| 小孩发育迟缓是什么原因造成的| 石榴代表什么生肖| 零七年属什么生肖| 怀才不遇是什么意思| 六月十四号是什么星座| 消化酶是什么| 独在异乡为异客的异是什么意思| 篇幅是什么意思| 饭后腹胀是什么原因| 哈字五行属什么| 洋气是什么意思| 违背是什么意思| 旅行的意义是什么| 969368是什么电话| 天蝎座跟什么星座最配| 梦见死尸什么预兆| 运钞车押运员是什么人| 2月份是什么星座| 基因是什么意思| 铁剂不能与什么同服| 痔疮是什么样的图片| c反应蛋白高是什么意思| dmdm乙内酰脲是什么| 肝外胆管扩张什么意思| 香菇吃多了有什么危害| 10点是什么时辰| 乙状结肠冗长是什么意思| 晚饭吃什么最健康| 一吃就吐是什么病症| 自戕是什么意思| 狗咬人后狗为什么会死| 一串什么| emo是什么意思| 前列腺增生吃什么药最好| 眼睛老是流眼泪是什么原因| 银五行属性是什么| 葡萄胎是什么| 廉洁奉公是什么意思| 最好的假牙是什么材质| 一直咳嗽不见好是什么原因| 什么病不能吃茄子| 间歇性是什么意思| 开平方是什么意思| 心慌气短吃什么药最好| 荆芥的别名叫什么| 什么姿势最舒服| 钢笔ef尖是什么意思| 涩是什么意思| 子宫萎缩是什么原因| 秋葵什么季节吃| 念珠菌和霉菌有什么区别| 为什么会反胃想吐| 干呕是什么病的前兆| 月经期间吃西瓜有什么影响| 血压是什么意思| 2000年属什么| 一般细菌培养及鉴定是检查什么| 低压偏低是什么原因| 为什么孕酮会低| 神气活现是什么意思| 右侧胸膜增厚是什么意思| mickey是什么牌子| 36是什么罩杯| 什么是梅毒| 助产学是干什么的| seiko是什么牌子| 莴笋炒什么好吃| 伊人是什么意思| 什么是邮箱地址应该怎么填写| 手腕发麻是什么原因| 11度穿什么衣服| 嘴唇发黑是什么原因| 白茶和绿茶有什么区别| 肺气肿挂什么科| 青鱼吃什么| 人云亦什么| 右肺下叶钙化灶是什么意思| 转氨酶高对身体有什么影响| 猫爪草长什么样| 狂躁症是什么| 急性肠胃炎用什么药| 枫字五行属什么| 戏梦巴黎讲的是什么| 浮肿是什么原因| 腻歪是什么意思| 2002年五行属什么命| 手心干燥是什么原因| 什么行什么什么| 吃什么食物补脾虚| 学分是什么| 什么是实性结节| 天蝎座男和什么星座最配| 新生儿打嗝是什么原因| 貔貅和麒麟有什么区别| 睾丸长什么样| 黄连素又叫什么名字| 算力是什么| 神经痛吃什么药效果好| 治白内障用什么药最好| 人模狗样是什么生肖| 李叔同为什么出家| 灵芝泡水喝有什么功效| 医院特需号是什么意思| 小腿前侧肌肉叫什么| dm表示什么单位| 高温中暑吃什么药| psa是什么| 什么食物属于发物| 避孕药有什么副作用| 身份证更换需要带什么| 磁共振和ct有什么区别| 川字属于五行属什么| 经常头疼什么原因| 斯德哥尔摩综合症是什么| 有什么作用| 01是什么生肖| 尿酸吃什么药最有效果| 靓是什么意思| 男性夜间盗汗什么原因| 急是什么结构| 牙刷属于什么垃圾| 神经痛吃什么药| 碳14和碳13有什么区别| 来袭是什么意思| 身体缺钾是什么原因造成的| ct挂什么科| 211大学什么意思| 省人大代表是什么级别| 大是什么意思| 德国什么东西值得买| 窝沟封闭什么意思| 1027是什么星座| 煮酒论英雄什么意思| 吃什么会变黑| 菡什么意思| 三聚磷酸钠是什么东西| 秃顶是什么原因造成的| 黑眼圈是什么原因导致的| 心血管疾病做什么检查| 阴道炎吃什么药好| 一什么浮萍| vjc是什么品牌| 脸颊两边长斑是什么原因| 什么逼人| 百度Jump to content

话题 | 长这么大,你有哪些事情是没做过的?

From Wikipedia, the free encyclopedia
(Redirected from Program state)
百度 ”  老将有望造惊喜  同样值得关注的还有女子帆板的陈佩娜。

In information technology and computer science, a system is described as stateful if it is designed to remember preceding events or user interactions;[1] the remembered information is called the state of the system.

The set of states a system can occupy is known as its state space. In a discrete system, the state space is countable and often finite. The system's internal behaviour or interaction with its environment consists of separately occurring individual actions or events, such as accepting input or producing output, that may or may not cause the system to change its state. Examples of such systems are digital logic circuits and components, automata and formal language, computer programs, and computers.

The output of a digital circuit or deterministic computer program at any time is completely determined by its current inputs and its state.[2]

Digital logic circuit state

[edit]

Digital logic circuits can be divided into two types: combinational logic, whose output signals are dependent only on its present input signals, and sequential logic, whose outputs are a function of both the current inputs and the past history of inputs.[3] In sequential logic, information from past inputs is stored in electronic memory elements, such as flip-flops. The stored contents of these memory elements, at a given point in time, is collectively referred to as the circuit's state and contains all the information about the past to which the circuit has access.[4]

Since each binary memory element, such as a flip-flop, has only two possible states, one or zero, and there is a finite number of memory elements, a digital circuit has only a certain finite number of possible states. If N is the number of binary memory elements in the circuit, the maximum number of states a circuit can have is 2N.

Program state

[edit]

Similarly, a computer program stores data in variables, which represent storage locations in the computer's memory. The contents of these memory locations, at any given point in the program's execution, are called the program's state.[5][6][7]

A more specialized definition of state is used for computer programs that operate serially or sequentially on streams of data, such as parsers, firewalls, communication protocols and encryption. Serial programs operate on the incoming data characters or packets sequentially, one at a time. In some of these programs, information about previous data characters or packets received is stored in variables and used to affect the processing of the current character or packet. This is called a stateful protocol and the data carried over from the previous processing cycle is called the state. In others, the program has no information about the previous data stream and starts fresh with each data input; this is called a stateless protocol.

Imperative programming is a programming paradigm (way of designing a programming language) that describes computation in terms of the program state, and of the statements which change the program state. Changes of state are implicit, managed by the program runtime, so that a subroutine has visibility of the changes of state made by other parts of the program, known as side effects.

In declarative programming languages, the program describes the desired results and doesn't specify changes to the state directly.

In functional programming, state is usually represented with temporal logic as explicit variables that represent the program state at each step of a program execution: a state variable is passed as an input parameter of a state-transforming function, which returns the updated state as part of its return value. A pure functional subroutine only has visibility of changes of state represented by the state variables in its scope.

Finite-state machines

[edit]

The output of a sequential circuit or computer program at any time is completely determined by its current inputs and current state. Since each binary memory element has only two possible states, 0 or 1, the total number of different states a circuit can assume is finite, and fixed by the number of memory elements. If there are N binary memory elements, a digital circuit can have at most 2N distinct states. The concept of state is formalized in an abstract mathematical model of computation called a finite-state machine, used to design both sequential digital circuits and computer programs.

Examples

[edit]

An example of an everyday device that has a state is a television set. To change the channel of a TV, the user usually presses a channel up or channel down button on the remote control, which sends a coded message to the set. In order to calculate the new channel that the user desires, the digital tuner in the television must have stored in it the number of the current channel it is on. It then adds one or subtracts one from this number to get the number for the new channel, and adjusts the TV to receive that channel. This new number is then stored as the current channel. Similarly, the television also stores a number that controls the level of volume produced by the speaker. Pressing the volume up or volume down buttons increments or decrements this number, setting a new level of volume. Both the current channel and current volume numbers are part of the TV's state. They are stored in non-volatile memory, which preserves the information when the TV is turned off, so when it is turned on again the TV will return to its previous station and volume level.

As another example, the state of a microprocessor is the contents of all the memory elements in it: the accumulators, storage registers, data caches, and flags. When computers such as laptops go into hibernation mode to save energy by shutting down the processor, the state of the processor is stored on the computer's hard disk, so it can be restored when the computer comes out of hibernation, and the processor can take up operations where it left off.

See also

[edit]

References

[edit]
  1. ^ "What is stateless? - Definition from WhatIs.com". techtarget.com.
  2. ^ Harris, David Money; Harris, Sarah L. (2007). Digital Design and Computer Architecture. USA: Morgan Kaufmann. p. 103. ISBN 978-0123704979.
  3. ^ Kaeslin, Hubert (2008). Digital Integrated Circuit Design: From VLSI Architectures to CMOS Fabrication. UK: Cambridge University Press. p. 735. ISBN 978-0521882675.
  4. ^ Srinath, N. K. (August 2005). 8085 Microprocessor: Programming and Interfacing. Prentice-Hall of India Pvt. Ltd. p. 326. ISBN 978-8120327856. Retrieved 7 December 2012. page 46
  5. ^ Laplante, Philip A. (2000). Dictionary of Computer Science, Engineering and Technology. USA: CRC Press. p. 466. ISBN 978-0849326912.
  6. ^ Misra, Jayadev (2001). A Discipline of Multiprogramming: Programming Theory for Distributed Applications. Springer. p. 14. ISBN 978-0387952062.
  7. ^ Prata, Stephen Prata (2004). C Primer Plus, 5th Ed. Pearson Education. pp. 113–114. ISBN 978-0132713603.
甘油三酯高说明什么 眼睛疼吃什么药 萤火虫吃什么食物 尿蛋白2加是什么意思 脚麻什么原因
梦见生孩子是什么征兆 梦之蓝是什么香型 属鸡适合佩戴什么饰品 血压压差小是什么原因 knee是什么意思
最近我和你都有一样的心情什么歌 为什么喜欢一个人 缺铁性贫血的人吃什么补血最快 宝宝入盆有什么感觉 矫枉过正什么意思
无名指为什么叫无名指 高血压吃什么药 自己是什么意思 捡到狗狗代表什么预兆 肚脐下四指是什么位置
类风湿吃什么药shenchushe.com 桂枝和肉桂有什么区别hcv8jop7ns4r.cn 补气血喝什么口服液好hcv8jop9ns4r.cn 呕吐后吃什么食物好hcv9jop2ns6r.cn 醋酸面料是什么hcv9jop5ns4r.cn
德行是什么意思hcv9jop6ns8r.cn 促甲状腺激素高是什么意思hcv8jop0ns6r.cn alp是什么意思hcv8jop0ns4r.cn 蜜饯是什么东西hcv8jop2ns8r.cn 四月二十六是什么星座hcv9jop5ns8r.cn
脑干出血是什么原因hcv9jop2ns7r.cn 熊猫长什么样hcv8jop5ns9r.cn 胃胀是什么原因导致的hcv7jop6ns7r.cn 痛风什么药止痛最快wzqsfys.com hpv感染有什么症状hcv8jop0ns4r.cn
坐骨神经痛有什么症状hcv8jop9ns0r.cn 血府逐瘀丸治什么病hcv7jop4ns8r.cn 梨子是什么季节的水果hcv9jop5ns9r.cn 为什么姓张的不用说免贵hcv9jop6ns9r.cn 头发为什么长不长hcv9jop3ns8r.cn
百度