当前位置:网站首页>Fundamentals of digital circuit (V) arithmetic operation circuit
Fundamentals of digital circuit (V) arithmetic operation circuit
2022-07-06 14:34:00 【ブリンク】
Fundamentals of digital circuits ( 5、 ... and ) Arithmetic Operation Circuits
One 、 Binary addition circuit
1. Half adder and full adder
(1) Half adder
A semi adder is one that only considers the addition of two one bit binary numbers , The arithmetic circuit without considering the low carry . The following figure shows the logic diagram of the half adder :
A A A and B B B When the input of the terminal is different , S S S The sum of the output is 1; Phase at the same time ,S The output is 0, Conform to the addition rules of binary . But when A A A and B B B All for 1 when , A carry up will occur , here C C C The output of is 1.
(2) Full adder
On the basis of half adder , Consider the carry of the local digit from the low order , Constitutes a full adder . According to the rules of binary addition , We first give the truth table of the full adder , As shown in the figure below :
According to the truth table, we can write logical expressions :
S i = A i ⊕ B i ⊕ C i , C i + 1 = A i B i + C i ( A I ⊕ B i ) S_i=A_i\oplus B_i \oplus C_i,C_{i+1}=A_iB_i+C_i(A_I\oplus B_i) Si=Ai⊕Bi⊕Ci,Ci+1=AiBi+Ci(AI⊕Bi)
Therefore, its logic diagram can be drawn as shown in the following figure :
Full adder is the most basic arithmetic logic unit in computer .
2. adder
Only the traveling wave carry adder is introduced here , This kind of adder starts from the lowest bit to add , Gradually carry to the highest position , As the number of digits increases , Its computing speed will also slow down . When connecting the circuit , The number of adders is equal to the number of addends and the number of digits of addends , Although the calculation speed is not very fast , But its connection is relatively simple .
As shown in the figure is the connection diagram of a four bit traveling wave carry adder :
Two 、 Binary subtraction circuit
Although we can design half subtracter and full subtracter by logical expression of truth table , But we usually use adders to realize the function of subtraction .
1. Representation of binary positive and negative numbers
(1) Original code
The original code refers to adding a sign bit in front of the binary number , The sign bit of a positive number is 0, The sign bit of a negative number is 1, The rest of you represent the absolute value of numbers , such as :+10110 The original code is 010110, and -10110 The original code is 110110.
(2) Complement code
The complement of a positive number is the same as itself .
The complement of a negative number is its own inverse plus 1, And its inverse code is obtained by inverting all digits except the sign bit . for example :11101 The opposite of 10010, add 1 Get its complement, that is :10011.
2. Subtraction circuits
Because subtracting a number is equal to adding a negative number , Minus a negative number is equal to plus a positive number , So we can use addition to realize subtraction . We have such a cycle in the clock :
For example, the time is now 13:00, I want to arrive 12:00, Then there are two ways , One is to wait until 11 Hours ; One is time reversal 1 Hours ; Another example is now 20:00, I want to arrive 15:00, There are also two ways , The first is to wait 7 Hours ( The pointer now points to 3), One is time reversal 5 Hours . We regard the waiting time as adding a number , Think of time reversal as subtracting a number , We found that , Add and subtract two different numbers , The results are the same , And we find that the sum of the absolute values of these two numbers is 12, Is a fixed value . Because the clock itself is a cycle , The principle of complement subtraction is the same , The complement and its own sum are always 0, Therefore, it is equivalent to subtracting a number and adding the complement of this number .
When we need to achieve this effect , Use the adder you learned before , Just convert the addend to the form of complement and add .
边栏推荐
- MySQL中什么是索引?常用的索引有哪些种类?索引在什么情况下会失效?
- Wu Enda's latest interview! Data centric reasons
- Statistics 8th Edition Jia Junping Chapter IX summary of knowledge points of classified data analysis and answers to exercises after class
- Sword finger offer 23 - print binary tree from top to bottom
- SQL注入
- An unhandled exception occurred when C connected to SQL Server: system Argumentexception: "keyword not supported:" integrated
- 函数:求方程的根
- Xray and Burp linked Mining
- Load balancing ribbon of microservices
- Bing Dwen Dwen official NFT blind box will be sold for about 626 yuan each; JD home programmer was sentenced for deleting the library and running away; Laravel 9 officially released | Sifu weekly
猜你喜欢
Intranet information collection of Intranet penetration (2)
Network technology related topics
《统计学》第八版贾俊平第十二章多元线性回归知识点总结及课后习题答案
Internet Management (Information Collection)
Statistics 8th Edition Jia Junping Chapter 10 summary of knowledge points of analysis of variance and answers to exercises after class
How to understand the difference between technical thinking and business thinking in Bi?
Hcip -- MPLS experiment
Library management system
Interview Essentials: what is the mysterious framework asking?
《英特尔 oneAPI—打开异构新纪元》
随机推荐
函数:求方程的根
How to turn wechat applet into uniapp
《统计学》第八版贾俊平第十章方差分析知识点总结及课后习题答案
《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案
msf生成payload大全
Record once, modify password logic vulnerability actual combat
Attack and defense world misc practice area (GIF lift table ext3)
SQL injection
《统计学》第八版贾俊平第三章课后习题及答案总结
关于超星脚本出现乱码问题
XSS (cross site scripting attack) for security interview
Intranet information collection of Intranet penetration (3)
Captcha killer verification code identification plug-in
How to test whether an object is a proxy- How to test if an object is a Proxy?
函数:用牛顿迭代法求方程的根
Hackmyvm target series (2) -warrior
[err] 1055 - expression 1 of order by clause is not in group by clause MySQL
Data mining - a discussion on sample imbalance in classification problems
Statistics 8th Edition Jia Junping Chapter 14 summary of index knowledge points and answers to exercises after class
四元数---基本概念(转载)