当前位置:网站首页>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 .
边栏推荐
猜你喜欢

数据库多表链接的查询方式

记一次edu,SQL注入实战

Hcip -- MPLS experiment

How to earn the first pot of gold in CSDN (we are all creators)

Intranet information collection of Intranet penetration (3)

Statistics, 8th Edition, Jia Junping, Chapter VIII, summary of knowledge points of hypothesis test and answers to exercises after class

Hackmyvm target series (2) -warrior

Attack and defense world misc practice area (simplerar, base64stego, no matter how high your Kung Fu is, you are afraid of kitchen knives)

Chain team implementation (C language)

《统计学》第八版贾俊平第九章分类数据分析知识点总结及课后习题答案
随机推荐
The difference between layer 3 switch and router
《统计学》第八版贾俊平第十一章一元线性回归知识点总结及课后习题答案
Sentinel overall workflow
《统计学》第八版贾俊平第六章统计量及抽样分布知识点总结及课后习题答案
内网渗透之内网信息收集(四)
图书管理系统
c语言学习总结(上)(更新中)
1.支付系统
5分钟掌握机器学习鸢尾花逻辑回归分类
Low income from doing we media? 90% of people make mistakes in these three points
Overview of LNMP architecture and construction of related services
[issue 18] share a Netease go experience
我的第一篇博客
线程的实现方式总结
Record an API interface SQL injection practice
Constants, variables, and operators of SystemVerilog usage
Uibutton status exploration and customization
Xray and burp linkage mining
《统计学》第八版贾俊平第十三章时间序列分析和预测知识点总结及课后习题答案
记一次edu,SQL注入实战