<< Chapter < Page Chapter >> Page >
  • Phương thức số dư để biến đổi phần nguyên của số thập phân sang nhị phân.

***SORRY, THIS MEDIA TYPE IS NOT SUPPORTED.*** bit có trọng số nhỏ nhấtbit giữVí dụ: Đổi 23.37510 sang nhị phân. Chúng ta sẽ chuyển đổi phần nguyên dùng phương thức số dư:

  • ***SORRY, THIS MEDIA TYPE IS NOT SUPPORTED.*** bit có trọng số lớn nhấtPhương thức nhân để biến đổi phần lẻ của số thập phân sang nhị phân

bit có trọng số nhỏ nhất

Kết quả cuối cùng nhận được là: 23.37510 = 10111.0112

Tuy nhiên, trong việc biến đổi phần lẻ của một số thập phân sang số nhị phân theo phương thức nhân, có một số trường hợp việc biến đổi số lặp lại vô hạn

Ví dụ:

Trường hợp biến đổi số nhị phân sang các hệ thống số khác nhau, ta có thể nhóm một số các số nhị phân để biểu diễn cho số trong hệ thống số tương ứng.

Binary(Base 2) Octal(Base 8) Decimal(Base 10) Hexadecimal(Base 16)
0000 0 0 0
0001 1 1 1
0010 2 2 2
0011 3 3 3
0100 4 4 4
0101 5 5 5
0110 6 6 6
0111 7 7 7
1000 10 8 8
1001 11 9 9
1010 12 10 A
1011 13 11 B
1100 14 12 C
1101 15 13 D
1110 16 14 E
1111 17 15 F

Thông thường, người ta nhóm 4 bit trong hệ nhị phân hệ để biểu diễn số dưới dạng thập lục phân (Hexadecimal).

Như vậy, dựa vào cách biến đổi số trong bảng nêu trên, chúng ta có ví dụ về cách biến đổi các số trong các hệ thống số khác nhau theo hệ nhị phân:

  • 10112 = (102)(112) = 234
  • 234 = (24)(34) = (102)(112) = 10112
  • 1010102 = (1012)(0102) = 528
  • 011011012 = (01102)(11012) = 6D16

Một từ n bit có thể biểu diễn tất cả các số dương từ 0 tới 2n-1. Nếu di là một số nhị phân thứ i, một từ n bit tương ứng với một số nguyên thập phân.

N = i = 0 n 1 d i 2 i size 12{ Sum cSub { size 8{i=0} } cSup { size 8{n-1} } {d rSub { size 8{i} } 2 rSup { size 8{i} } } } {}

Một Byte (gồm 8 bit) có thể biểu diễn các số từ 0 tới 255 và một từ 32 bit cho phép biểu diễn các số từ 0 tới 4294967295.

Số nguyên có dấu

Có nhiều cách để biểu diễn một số n bit có dấu. Trong tất cả mọi cách thì bit cao nhất luôn tượng trưng cho dấu.

Khi đó, bit dấu có giá trị là 0 thì số nguyên dương, bit dấu có giá trị là 1 thì số nguyên âm. Tuy nhiên, cách biểu diễn dấu này không đúng trong trường hợp số được biểu diễn bằng số thừa K mà ta sẽ xét ở phần sau trong chương này (bit dấu có giá trị là 1 thì số nguyên dương, bit dấu có giá trị là 0 thì số nguyên âm).

dn-1 dn-2 dn-3 . . . . d2d1d0

. . . .

bit dấu

Số nguyên có bit dn-1 là bit dấu và có trị số tượng trưng bởi các bit từ d0 tới dn-2 .

A) cách biểu diễn bằng trị tuyệt đối và dấu

Trong cách này, bit dn-1 là bit dấu và các bit từ d0 tới dn-2 cho giá trị tuyệt đối. Một từ n bit tương ứng với số nguyên thập phân có dấu.

N = ( 1 ) d n 1 i = 0 n 2 d i 2 i size 12{ \( - 1 \) rSup { size 8{d rSub { size 6{n - 1} } } } Sum cSub {i=0} cSup {n - 2} {d rSub {i} size 12{2 rSup {i} }} } {}

Ví dụ: +2510 = 000110012

-2510 = 100110012

  • Một Byte (8 bit) có thể biểu diễn các số có dấu từ -127 tới +127.
  • Có hai cách biểu diễn số không là 0000 0000 (+0) và 1000 0000 (-0).

B) cách biểu diễn hằng số bù 1

Trong cách biểu diễn này, số âm -N được có bằng cách thay các số nhị phân di của số đương N bằng số bù của nó (nghĩa là nếu di = 0 thì người ta đổi nó thành 1 và ngược lại).

Ví dụ: +2510 = 000110012

-2510 = 111001102

  • Một Byte cho phép biểu diễn tất cả các số có dấu từ -127 (1000 00002) đến 127 (0111 11112)
  • Có hai cách biểu diễn cho 0 là 0000 0000 (+0) và 1111 1111 (-0).

C) cách biểu diễn bằng số bù 2

Để có số bù 2 của một số nào đó, người ta lấy số bù 1 rồi cộng thêm 1. Vậy một từ n bit (dn-1 ....... d0) có trị thập phân.

Questions & Answers

what does preconceived mean
sammie Reply
physiological Psychology
Nwosu Reply
How can I develope my cognitive domain
Amanyire Reply
why is communication effective
Dakolo Reply
Communication is effective because it allows individuals to share ideas, thoughts, and information with others.
effective communication can lead to improved outcomes in various settings, including personal relationships, business environments, and educational settings. By communicating effectively, individuals can negotiate effectively, solve problems collaboratively, and work towards common goals.
it starts up serve and return practice/assessments.it helps find voice talking therapy also assessments through relaxed conversation.
miss
Every time someone flushes a toilet in the apartment building, the person begins to jumb back automatically after hearing the flush, before the water temperature changes. Identify the types of learning, if it is classical conditioning identify the NS, UCS, CS and CR. If it is operant conditioning, identify the type of consequence positive reinforcement, negative reinforcement or punishment
Wekolamo Reply
please i need answer
Wekolamo
because it helps many people around the world to understand how to interact with other people and understand them well, for example at work (job).
Manix Reply
Agreed 👍 There are many parts of our brains and behaviors, we really need to get to know. Blessings for everyone and happy Sunday!
ARC
A child is a member of community not society elucidate ?
JESSY Reply
Isn't practices worldwide, be it psychology, be it science. isn't much just a false belief of control over something the mind cannot truly comprehend?
Simon Reply
compare and contrast skinner's perspective on personality development on freud
namakula Reply
Skinner skipped the whole unconscious phenomenon and rather emphasized on classical conditioning
war
explain how nature and nurture affect the development and later the productivity of an individual.
Amesalu Reply
nature is an hereditary factor while nurture is an environmental factor which constitute an individual personality. so if an individual's parent has a deviant behavior and was also brought up in an deviant environment, observation of the behavior and the inborn trait we make the individual deviant.
Samuel
I am taking this course because I am hoping that I could somehow learn more about my chosen field of interest and due to the fact that being a PsyD really ignites my passion as an individual the more I hope to learn about developing and literally explore the complexity of my critical thinking skills
Zyryn Reply
good👍
Jonathan
and having a good philosophy of the world is like a sandwich and a peanut butter 👍
Jonathan
generally amnesi how long yrs memory loss
Kelu Reply
interpersonal relationships
Abdulfatai Reply
What would be the best educational aid(s) for gifted kids/savants?
Heidi Reply
treat them normal, if they want help then give them. that will make everyone happy
Saurabh
What are the treatment for autism?
Magret Reply
hello. autism is a umbrella term. autistic kids have different disorder overlapping. for example. a kid may show symptoms of ADHD and also learning disabilities. before treatment please make sure the kid doesn't have physical disabilities like hearing..vision..speech problem. sometimes these
Jharna
continue.. sometimes due to these physical problems..the diagnosis may be misdiagnosed. treatment for autism. well it depends on the severity. since autistic kids have problems in communicating and adopting to the environment.. it's best to expose the child in situations where the child
Jharna
child interact with other kids under doc supervision. play therapy. speech therapy. Engaging in different activities that activate most parts of the brain.. like drawing..painting. matching color board game. string and beads game. the more you interact with the child the more effective
Jharna
results you'll get.. please consult a therapist to know what suits best on your child. and last as a parent. I know sometimes it's overwhelming to guide a special kid. but trust the process and be strong and patient as a parent.
Jharna
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Cơ sở văn hóa việt. OpenStax CNX. Jul 29, 2009 Download for free at http://cnx.org/content/col10757/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Cơ sở văn hóa việt' conversation and receive update notifications?

Ask