Tag Info

37

No matter what base system you use it is called a digit. So if it is not clear from the context and you need/want to emphasize that it is a digit of a number in base 8 representation then call it octal digit. Note: Also "bit" is just short for "binary digit".

25

Memory addresses are binary numbers. The range of an N-bit (unsigned) binary number is 0 to 2N-1, a total of 2N different values. Since addresses are passed to memory chips as binary numbers, it makes sense to build them in capacities of powers of 2. That way, none of the address space is wasted, and it's easy to combine multiple chips/modules to build ...

24

Ah, you're missing the STATE MACHINE concept. That's where we can "write code" made out of TTL hardware chips: data-selectors, 4-bit counters, gangs of parallel flipflops. (But all those are the complicated parts, while the idea behind "state machines" is fairly simple.) "State-machine" is also commonly called "micro-code." Also called "bit-slice" or "...

22

It depends how old the ISA is. In the early days of hand design, and even more so when CPUs were assembled from discrete logic, the logic design would have come first, and been extensively minimised, and then the ISA bit patterns would have been whatever values were required to make that minimal logic work. So there may be a particular pattern of control ...

20

cyclic ˈsʌɪklɪk,ˈsɪklɪk/ adjective 1. occurring in cycles; regularly repeated. You haven't given a reference for the 'cyclic code' terminology but there is certainly a cyclic patter. This is most obvious in an encoder disc. Figure 1. The cyclic pattern of each bit is clearly visible on this optical absolute encoder disc. Each bit has a repeating on-off ...

19

Do you know how to check for divisibility by 9 in base 10? Add all the digits using base 10 arithmetic. If the result has multiple digits, repeat the process. Stop when you have one digit. If the digit is 9, the original number was divisible by 9. This works because the divisor being tested is base-1. For instance 45 is divisible by 9, and the digits sum to ...

17

If you feed something to a UART port of a microprocessor you must follow the UART communication protocol if you want the microprocessor to understand what you are feeding it. You need to embed each ASCI character into a UART package that contains a start bit, a stop bit and possibly a parity bit, a lot more information is available on the UART Wikipedia page....

16

Clearing up some misunderstandings will probably help. First, your data is a 16-bit value. There's no "overflows" and "actual data" -- the 16 bits are just divided into two 8-bit pieces (bytes). To get the right binary value, you need to concatenate the bytes. In C, you can do it by starting with unsigned values and using bitwise operators, like this: ...

15

Actually, the answer to your seemingly simple question is more complex than you'd readily believe! The short answer is that one signal at a time can be passed through a single signal wire, in one cycle. The amount of data that symbol represents depends on the protocol used. The long answer is that: 2-state protocols, like OOK (On-Off Keying), pass only one ...

15

Take the four bit Gray code sequence below and print it out then cut it out with scissors. Then wrap the ends round and tape them together so you have a Gray-code band. As you rotate the band notice there is only one bit change between every spot that is facing you, even when you cross the tape. That is, it is a cyclic code that has no start and no end. ...

13

A 1024 x 1 memory chip requires 10 address lines and you get full utilisation of all addresses. Now, if someone brought out a 600 x 1 memory chip, it would still need 10 address lines. It can’t use 9 because that could only uniquely define 512 memory positions. Then think of what would happen if someone wanted to use two of the 600 x 1 memory chips to give ...

12

Two's compliment representation of signed integers is easy to manipulate in hardware. For example, negation (i.e. x = -x) can be performed simply by flipping all the bits in the number and adding one. Performing the same operation in raw binary (e.g. with a sign bit) usually involves a lot more work, because you must treat certain bits in the stream as ...

9

What it means to be normalized is dependent on the particular floating point format. Some formats have no way of expressing unnormalized values. Decimal example I'll illustrate normalization using decimal. Suppose you store floating point values as 6 signed digits with a signed 2 digit power of 10 exponent. for example, 123456 07 means 123456x107. ...

9

If you group similar instructions together, patterns will emerge. This is very obvious in ARM, where the ISA manual actually shows you which bit of an instruction word correspond to function, register choice, etc. But it can also be inferred for X86. Ultimately the "function" part of opcodes go into some binary-to-onehot decoder that actually activates a ...

9

The Gray code for decimal 15 rolls over to decimal 0 with only one switch change. This is called the "cyclic" property of a Gray code. Straight from the Wikipedia article.

9

You could use a binary adder on the 4020 output lines. Then use the output of the adder instead of the direct output. You'd need something like a bunch of DIP switches to set the offset (that gets added). Then, when the 4020 is reset, the adder's output becomes the value set by the DIP switches (or MCU or whatever). Here's a typical 4-bit adder in case it is ...

8

You can manipulate arbitrarily wide numbers using a finite width ALU. However, multiple operations are required when the number is wider than the ALU. To illustrate this, I'll use a PIC 18 as example. This architecture can manipulate only 8 bit numbers directly. To add the 8 bit quantities VAR1 and VAR2 and put the result into SUM would take code like ...

8

A processor is really a finite state machine (FSM) for implementing the machine code instructions. It reads the instructions from memory and uses the required hardware, such as the ALU, to implement them. Here is the data path of the MIPS architecture. source You have a control unit implementing said FSM and is responsible for ensuring the data is ...

7

This is a simple job for a microcontroller. Spehro correctly points out that it can be accomplished with a simple lookup. If you can tolerate lower speed then counting the bits in a loop will do it too, but will take less code space. Another way is to do this in analog. Put a 100 kΩ resistor in series with each digital output, then feed that into a ...

7

A microcontroller could do it very easily. Since there are only 256 possible combinations, a simple lookup table would be the fastest way. (I did the below outputting 8 for all high for consistency, you can change the last entry to 7 if you want). The code could look something like this:- unsigned char lut[256] = {0x0, 0x1, 0x1, 0x2, 0x1, 0x2, 0x2, 0x3, ...

7

You extend the MSb to the left, since that determines the sign. The value will not change at the new number of bits. 0xFEF7 0x07FE

7

In 2's complement, 1000 does not represent 0, but rather -8. So, in your ADC (or DAC), you would use it to represent -4.0 V. More precisely, in an ADC, each code would represent the center of its range: Code ADC input DAC output ---- ---------------- ---------- 0000: -0.25 to +0.25 V 0.00 V 0001: +0.25 to +0.75 V +0....

6

Your question assumes that there are somehow two kinds of electricity, analog and digital. This is not the case. The difference between analog and digital is how we humans interpret an electrical signal. Electricity is electricity, it does not care how we interpret it. For an analog signal we interpret its level value (voltage, or sometimes current) as ...

6

LEDs like that are commonly driven by shift registers. A shift register takes 3 inputs from the arduino (Data, Enable and Clock), takes a (for example) 8 bit number, then outputs it on 8 different pins. One example is like this: Shift Register 8-Bit - 74HC595

6

Actually the ENIAC, considered to be the first large scale general purpose programmable electronic computer, used a scheme almost identical to what you propose. It used ten-position ring counters to store digits in ten's complement representation. Each digit used 36 vacuum tubes, 10 of which were the dual triodes making up the flip-flops of the ring ...

6

There are a lot of techniques for this. You may want to look at Manchester coding or NRZ codes. Or 8b/10b coding, which maps every 8 data bits to a 10-bit sequence that allows for clock recovery, error correction, and special "comma" symbols that can be used to detect the start and end of a transmission.

6

Welcome to SE, Johnny. You have a few terms mixed up. I take it from the question you want a beginner's grasp of what's going on. Hertz is the number of cycles per second. A very simple explanation A (simplistic) way to understand this would be to imagine a signalling system that transmits ones and zeros as pulses. simulate this circuit – Schematic ...

6

This isn't particularly different from multiplying two fixed point numbers with the same format. You need to do a multiplication which preserves the most significant bits, then shift the binary point back to the desired output format. So, do a 16x16 => 32 bit multiplication. The binary point is then at position 13+6 = 19, so you have a Q13.19 format number. ...

6

First convert it to binary: 0001 1011 0000 1000 1100 0010 0010 1011 Then map it to its fields: 0 00110110 00010001100001000101011 S exponent -------mantissa-------- $S=0$ so the value is positive. The exponent is stored in excess-127 notation, which simply means they wanted negative magnitudes to sort smaller than positive magnitudes when the sort ...

6

There is an option to randomize the build process, which IIRC is enabled by default. As FPGA layout is an optimization problem with high complexity, it is not possible to find the globally optimal layout in a sensible time frame. The compiler instead starts with a random but correct layout, and performs local optimizations on it, until no further ...

Only top voted, non community-wiki answers of a minimum length are eligible