首页 > 其他 > 详细

digital fundamentals

时间:2020-05-05 13:25:44      阅读:87      评论:0      收藏:0      [点我收藏+]

chapter 1 digital concepts

digital and analog quantities

an analog quantity is one having continuous values. a digital digital quantity is one having a discrete set of values.


binary digits

positive logic: HIGH=1;LOW=0;

negative logic: HIGH=0;LOW=1;


logic levels

in a practical digital circuit, however, a high can be any voltage level between a specified minimum value and a specified maximum value.likewise, a low can be any voltage level between a specified minimum value and a specified maximum value.

no overlap(重叠)


digital waveforms

positive-going pulse: rising edge(leading edge), falling edge(trailing edge)

negative-going pulse:rising edge(trailing edge), falling edge(leading edge)


rise time [fall time]: 10% of the pulse amplitude (height from baseline) to 90%

pulse width: between 50% points

duty cycle(占空比)=pulse width/ the period (T).


chapter 2 number system, operations, and codes

decimal numbers

binary numbers:  the weight


binary-to-decimal conversion

decimal-to-binary conversion:

sum- of- weights method----9=8+1=2^3+1

repeated division- by- 2 method----短除法逆序

12/2=6......0

  6/2=3......0

  3/2=1......1

  1/2=0......1

12=1100(B)

converting decimal fraction to binary

0.3125x2=0.625……0

  0.625x2=  1.25……1

  0.25  x2=  0.50……0

  0.50 x2=  1.00……1

(个位)0.3125=.0101(B)


1’s and 2’s complements of binary numbers

finding the 1’s complement: 10110010---->01001101

finding the 2’s complement:

2’s complement=(1’s complement)+1: 10110010---->01001101+1=01001110


signed numbers

a 0 sign bit indicates a positive number, and a 1 sign bit indicates a negative number.

the decimal value of signed numbers

2’s complement

-2^7  2^6  2^5  2^4  2^3  2^2  2^1  2^0

  1       0      1     0      1     0      1      0

=-128+32+8+2=-86

10101010---->11010101+1=11010110=-(64+16+4+2)=-86


range of signed integer numbers that can be represented

range=-(2^(n-1))to (2^(n-1)-1)


floating – point numbers

sign

mantissa: represents the magnitude of the number

exponent: represents the number of paces that the decimal point (or binary point ) is to be moved.(指数)

single-precision  -->s(1bit)—exponent(8    bits)—mantissa(23 bits)    [32 bits]

double-precision—>s(1 bit)—exponent(11 bits)—mantissa(52 bits)    [64 bits]

there are 24 bits(single precision) in the mantissa because in any binary number the left-most bit is always  a 1. therefore , this 1 is understood to be there although it does not occupy an actual bit position.

1011010010001=1.011010010001x 2^12

s=0,e=10001011=139=127+12,mantissa=01101001000100000000000

exponent-127


arithmetic operations with signed numbers

addition

both numbers positive: 00000111+00000100=00001011—>7+4=11

positive number with magnitude larger than negative number:00001111+11111010=1  00001001 (15-6=9)

negative number with magnitude larger than positive number:00010000+11101000=11111000  (16-24=-8)

both numbers negative:11111011=11110111=1  11110010 (-5-9=-14)

overflow condition(only occur when both numbers are positive or negative )

01111101+00111010=10110111 (125+58=183)


subtraction

  the sign of a positive  or negative number is changed by taking 2’s complement

00000100(+4) 11111100(-4)


multiplication

the partial method is perhaps the more common one because it reflects the way you multiply longhand.

step1—sign

step2—change any negative number to true(uncomplemented) form.

step3—generate the partial products(only the magnitude bits are used in these steps)

step4—add each partial products

step5—if sign that  was determined is negative, 2’s complement,if positive ,attach the sign bit to the product.


division

dividend / divisor =quotient

subtract the divisor


hexadecimal numbers


binary code decimal

digital fundamentals

原文:https://www.cnblogs.com/feishijieqiusheng/p/12830290.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!