当前位置:网站首页>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 .
边栏推荐
- How to test whether an object is a proxy- How to test if an object is a Proxy?
- Intranet information collection of Intranet penetration (3)
- High concurrency programming series: 6 steps of JVM performance tuning and detailed explanation of key tuning parameters
- List and data frame of R language experiment III
- 线程的实现方式总结
- Internet Management (Information Collection)
- How to understand the difference between technical thinking and business thinking in Bi?
- 【指针】查找最大的字符串
- 记一次edu,SQL注入实战
- 《统计学》第八版贾俊平第十二章多元线性回归知识点总结及课后习题答案
猜你喜欢
Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)
How to earn the first pot of gold in CSDN (we are all creators)
《英特尔 oneAPI—打开异构新纪元》
《统计学》第八版贾俊平第五章概率与概率分布
循环队列(C语言)
How to turn wechat applet into uniapp
Windows platform mongodb database installation
记一次api接口SQL注入实战
. Net6: develop modern 3D industrial software based on WPF (2)
WEB漏洞-文件操作之文件包含漏洞
随机推荐
【指针】使用插入排序法将n个数从小到大进行排列
Intranet information collection of Intranet penetration (2)
【指针】查找最大的字符串
《统计学》第八版贾俊平第八章假设检验知识点总结及课后习题答案
Wei Shen of Peking University revealed the current situation: his class is not very good, and there are only 5 or 6 middle-term students left after leaving class
JDBC看这篇就够了
msf生成payload大全
“人生若只如初见”——RISC-V
On the idea of vulnerability discovery
指针 --按字符串相反次序输出其中的所有字符
《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
Library management system
{1,2,3,2,5}查重问题
四元数---基本概念(转载)
MSF generate payload Encyclopedia
《统计学》第八版贾俊平第十章方差分析知识点总结及课后习题答案
Xray and burp linkage mining
移植蜂鸟E203内核至达芬奇pro35T【集创芯来RISC-V杯】(一)
c语言学习总结(上)(更新中)
XSS (cross site scripting attack) for security interview