Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Converting between number systems - easy and with a smile. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Beginner radio amateur

Comments on the article Comments on the article

Let's start again with the decimal system.

Let's take the same number 167 as an example (I don't know why exactly it came to my mind), and represent this number like this:

167 = 1*100 + 6*10 + 7*1

Isn't it fair? Well, the following is also true:

167 = 1*102 + 6*101 + 7*100

(any number to the 0th power is 1).

What have we done? We have multiplied the value of each digit by the base of the number system, raised to a power equal to the digit number (if the least significant digit is taken as 0th). Unclear?…

I explain.

The number 167 has three digits. The numbering of the digits always goes from right to left, from the youngest to the oldest. All normal people count from one. Abnormal, that is - we, electronic programmers, count from scratch. Remember this. FROM SCRATCH!!! Everything and always! So, that's why the least significant digit will be zero.

Total we get:

0 digit = 7

1 digit = 6

2 digit = 1

The number system is decimal. This means that its base is 10. We raise 10 to the power equal to the number of each digit and multiply by the fact that the value of the digit is obtained. Then we add it all up. It's that simple!

We pass (return) to the binary system.

Everything is exactly the same.

The number 10100 can be represented as:

1*24 + 0*23 + 1*22 + 0*21 + 0*20

or

16 + 0 + 4 + 0 + 0.

By extremely complex calculations, you can get the sum of all this. It is equal to 20.

So, gentlemen. We just converted a binary number to decimal.

It turned out that 101002 = 2010.

This is easy to do if you know the powers of two. Personally, I immediately name all integer powers of two from 0 to 18 by heart. I don’t really need to go further, and if necessary, I can always calculate. In the meantime, remember at least until the 16th:

= 20 1

= 21 2

= 22 4

= 23 8

= 24 16

= 25 32

= 26 64

= 27 128

= 28 256

= 29 512

= 210 1024

= 211 2048

= 212 4096

= 213 8192

= 214 16384

= 215 32768

= 216 65536

etc.

Well now let's convert the 8-bit binary number to decimal. To do this, draw the following table:

Conversions between number systems

In the top line of the table - multipliers by which you need to multiply the values ​​of the digits.

Take, for example, the number 10100111.

Let's put it in the table:

Conversions between number systems

Now we multiply the value of the digit by the multiplier of this digit and add the results:

1*128 + 0*64 + 1*32 + 0*16 + 0*8 + 1*4 + 1*2 + 1*1 =

= 128 + 32 + 4 + 2 + 1 = 167.

Oops! It turned out our dear number 167. Miracles! :)

All! Transformed!

Look what we ended up doing. As a result, we simply added the multipliers of those digits in which there were units. This conversion method is the easiest and simplest. And if in computer science lessons you were taught for a long time and to no avail to do a bunch of operations in a column - forget it. Everything is much easier!

Transformation 10 ->2

Now we will do the same, but in the opposite direction. Let's take the same number 167 and look at it carefully. Looked? Now look at the table (or rather, remember) what is the largest power of two even less than this number.

Obviously, this is 128. So, we draw the table again.

Conversions between number systems

The multiplier of the most significant digit in it will be equal to 128. Further - 64, 32, etc ... In total - 8 digits.

We immediately put 1 in the senior category. Further it will become clear why.

Conversions between number systems. 1xxxxxxx

Now subtract 167 from 128.

167 - 128 = 39

Since 39 is less than the next factor (64), we write 0 in the next bit.

Conversions between number systems. 10xxxxxx

Since nothing was taken away - the remainder is the same - 39. We look at the next factor: 32. It is less than 39, which means it can be taken away. We subtract, and put a unit in the discharge:

101xxxxx

The remaining number is 7. It is clearly less than 16 or 8, so the next two digits will be 0:

Conversions between number systems. 10100xxx

Farther:

7 - 4 = 3

Conversions between number systems. 101001xx

3 - 2 = 1

Conversions between number systems. 1010011x

1 - 1 = 0

Conversions between number systems. 10100111

Note. In the end, we should get ZERO! If zero did not work out, then we screwed up somewhere.

Publication: radiokot.ru

See other articles Section Beginner radio amateur.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Traffic noise delays the growth of chicks 06.05.2024

The sounds that surround us in modern cities are becoming increasingly piercing. However, few people think about how this noise affects the animal world, especially such delicate creatures as chicks that have not yet hatched from their eggs. Recent research is shedding light on this issue, indicating serious consequences for their development and survival. Scientists have found that exposure of zebra diamondback chicks to traffic noise can cause serious disruption to their development. Experiments have shown that noise pollution can significantly delay their hatching, and those chicks that do emerge face a number of health-promoting problems. The researchers also found that the negative effects of noise pollution extend into the adult birds. Reduced chances of reproduction and decreased fertility indicate the long-term effects that traffic noise has on wildlife. The study results highlight the need ... >>

Wireless speaker Samsung Music Frame HW-LS60D 06.05.2024

In the world of modern audio technology, manufacturers strive not only for impeccable sound quality, but also for combining functionality with aesthetics. One of the latest innovative steps in this direction is the new Samsung Music Frame HW-LS60D wireless speaker system, presented at the 2024 World of Samsung event. The Samsung HW-LS60D is more than just a speaker system, it's the art of frame-style sound. The combination of a 6-speaker system with Dolby Atmos support and a stylish photo frame design makes this product the perfect addition to any interior. The new Samsung Music Frame features advanced technologies including Adaptive Audio that delivers clear dialogue at any volume level, and automatic room optimization for rich audio reproduction. With support for Spotify, Tidal Hi-Fi and Bluetooth 5.2 connections, as well as smart assistant integration, this speaker is ready to satisfy your ... >>

A New Way to Control and Manipulate Optical Signals 05.05.2024

The modern world of science and technology is developing rapidly, and every day new methods and technologies appear that open up new prospects for us in various fields. One such innovation is the development by German scientists of a new way to control optical signals, which could lead to significant progress in the field of photonics. Recent research has allowed German scientists to create a tunable waveplate inside a fused silica waveguide. This method, based on the use of a liquid crystal layer, allows one to effectively change the polarization of light passing through a waveguide. This technological breakthrough opens up new prospects for the development of compact and efficient photonic devices capable of processing large volumes of data. The electro-optical control of polarization provided by the new method could provide the basis for a new class of integrated photonic devices. This opens up great opportunities for ... >>

Random news from the Archive

Construction of the largest neutrino telescope 18.02.2020

Japan approved the project of the largest neutrino telescope. The Hyper-Kamiokande detector will be installed next to the Kamioka mine, which already houses the Super-Kamiokande.

The new telescope will be located underground, at a depth of 650 meters. This is enough to screen most foreign particles - cosmic and terrestrial.

The "heart" of the new telescope will be a reservoir with a billion liters of pure water - eight and a half times more than that of the "Super-Kamiokande". The reservoir will be surrounded by several thousand highly sensitive photographic recorders designed to record neutrino events proper.

It will not be the neutrinos themselves that will be registered, which remain invisible, but high-energy particles, most often electrons, "knocked out" of matter in those rare cases when the all-penetrating neutrino still interacts with it. The particle then moves at a speed exceeding the speed of light in a given medium (in water), and intensively spends energy on Cherenkov radiation, the flashes of which are recorded by devices.

Scientists hope that the huge reservoirs of the installation will allow, in addition to registering neutrinos, to "catch" the decay of a proton.

Other interesting news:

▪ To the stars on the printer

▪ Synthetic lift

▪ Production of hydrogen fuel from air

▪ Gmail mobile

▪ Data transmission using fast neutrons

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Grounding and grounding. Selection of articles

▪ article The little mistress of the big house. Popular expression

▪ article Who managed to visit both a dwarf and a giant in his life? Detailed answer

▪ article Work on temostat. Standard instruction on labor protection

▪ article A device for checking telephone sets. Encyclopedia of radio electronics and electrical engineering

▪ article 1 + 1 is not always equal to two. Focus secret

Leave your comment on this article:

Name:


Email (optional):


A comment:





All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024