r/AskComputerScience • • Mar 06 '22

In binary 1 represents the existence of electric flow and 0 reps the none exists of it. Theoretically does sending information that contains more 0s than 1s will consume less power?

31 Upvotes

10 comments sorted by

48

u/PROvlhma Mar 06 '22

If that were the case you would be correct. But this is not the case.

0s and 1s represent voltage levels not current levels. For the shake of simplicity let's say that binary 1 means 1 volt and binary 0 means 0 volt.

Modern CMOS implementations theoretically consume zero power when idling, that is they consume power only when a transition from 0 to 1 or 1 to 0 happens.

So the count of 0s and 1s does not really play a role in power consumption.

22

u/nagix97 Mar 06 '22

It was essential that you mentioned that 1 and 0 reps the VOLTAGE not the CURRENT.

Now I see the clear picture.

So thanks!

2

u/jeffbell Mar 06 '22

The opposite is true for Emitter Coupled Logic family and current loop peripheral devices. In those cases ones and zeroes are represented by current rather than voltage.

2

u/PROvlhma Mar 06 '22

Emitter Coupled Logic family

Well BJTs are current driven so that makes sense.

0

u/[deleted] Mar 06 '22

[deleted]

10

u/PROvlhma Mar 06 '22

Let's put it this way, P (power) = v (voltage) * i (current).

The reason CMOS consumes (almost) zero power when idling is because each CMOS circuit consists of a network of P type mosfets and one of N type mosfets that they work complementary to each other. In simple words, if the P network is open then the N network is closed and visa versa. That means that at each point in time when idling there is zero current flow inside a circuit, as such P = v * 0 = 0 watts.

If you could provide the computer with a *very* specific flow of instructions such that the CMOS circuit inputs make them stay idle for a long time then yes, you would consume less power.

The problem is that there is practically no way to do this. The binary zeros and ones inside, for example, a text file you read in a C program are a very small part of the binary stream that is fed to the CPU circuit.

Also, there is a big abstraction over the computer organization scheme and the actual CMOS implementation. In other words, you could see that the input instruction is fed to a multiplexor and could think to optimize the instructions given to reduce power consumption in this multiplexor.

The problem is that this multiplexor scheme is translated through an HDL synthesizer into a circuit that is under no obligation to behave as you would expect.

TL;DR

You could, very theoretically, feed the computer a binary stream that actually made its circuits idle for a long time and reduce power, but this is practically impossible for a number of reasons.

2

u/Poddster Mar 07 '22

Vaguely. But the clock is still waggling up and down to make those long strings of 0s mean something, and everytime the clock twitches everything in the CPU moves in some way, even if it ends up back in the same spot. That's where most of the switching happens.

A lot of effort goes into gating the clock lines so that thing only change when they absolutely must, and therefore power consumption is lower.

2

u/Putnam3145 Mar 06 '22

You misunderstood: by "transition from 0 to 1 or 1 to 0", they don't mean "places where there's 0s adjacent to 1s", they mean "when something explicitly changes something from 0 to 1 or vice-versa", i.e. write operations.

7

u/Ragingman2 Mar 06 '22

Sending information is done using protocols such as USB, Ethernet, and HDMI. These protocols specify both the cable to use and what electrical signals should be sent over them.

The amount of power that sending a message takes depends on the protocol. In most modern protocols sending 1s or 0s won't make a difference because of how they are encoded. For example USB uses a differential pair signal in which there are two wires that each typically carry opposite voltages. You can look up various YouTube videos on USB for more details on how / why this is done.

3

u/Filmore Mar 06 '22

Uhm maybe? But not for the reason you think.

Without any other information on the data and only knowing the ratio of 0 to 1s, I would guess that highly lopsided data is probably also low entropy, and therefore can be compressed a lot. This would yield more information per power-unit when transmitting if you compressed it.

Caveat: It is easy to construct data where this assumption breaks (lots of 1s followed by lots of 0s for example)

3

u/Karovex Mar 06 '22

Current balance does play a role in some high-speed transmission designs. Differential pairs should theoretically always have a zero net current since it should always be equal-but-opposite in the pair.

Some protocols take this even further. For example, PCIe used bias encoding to balance the number of low-to-high and high-to-low transitions, which will also drive the net current flow towards 0 as well