当前位置:网站首页>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 .
边栏推荐
- Xray and burp linkage mining
- Sword finger offer 23 - print binary tree from top to bottom
- Intel oneapi - opening a new era of heterogeneity
- Markdown font color editing teaching
- How to earn the first pot of gold in CSDN (we are all creators)
- 函数:字符串反序存放
- 《统计学》第八版贾俊平第一章课后习题及答案总结
- 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
- The United States has repeatedly revealed that the yield of interest rate hiked treasury bonds continued to rise
- 关于超星脚本出现乱码问题
猜你喜欢

JDBC transactions, batch processing, and connection pooling (super detailed)

Data mining - a discussion on sample imbalance in classification problems

外网打点(信息收集)

《统计学》第八版贾俊平第十四章指数知识点总结及课后习题答案

记一次api接口SQL注入实战

Intranet information collection of Intranet penetration (4)

Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)

Detailed explanation of network foundation

Web vulnerability - File Inclusion Vulnerability of file operation

《统计学》第八版贾俊平第十章方差分析知识点总结及课后习题答案
随机推荐
Tencent map circle
Realize applet payment function with applet cloud development (including source code)
This article explains in detail how mockmvc is used in practical work
xray與burp聯動 挖掘
攻防世界MISC练习区(SimpleRAR、base64stego、功夫再高也怕菜刀)
Apache APIs IX has the risk of rewriting the x-real-ip header (cve-2022-24112)
《统计学》第八版贾俊平第三章课后习题及答案总结
How to test whether an object is a proxy- How to test if an object is a Proxy?
Detailed explanation of network foundation routing
JDBC read this article is enough
【指针】查找最大的字符串
Data mining - a discussion on sample imbalance in classification problems
The United States has repeatedly revealed that the yield of interest rate hiked treasury bonds continued to rise
Solutions to common problems in database development such as MySQL
An unhandled exception occurred when C connected to SQL Server: system Argumentexception: "keyword not supported:" integrated
内网渗透之内网信息收集(四)
MySQL interview questions (4)
Ucos-iii learning records (11) - task management
How to understand the difference between technical thinking and business thinking in Bi?
浅谈漏洞发现思路