1. Home
  2. Explore
  3. Computer Science
  4. Digital Circuits and Binary Data

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Digital Circuits and Binary Data

Speaker 1Speaker 2

Digital Circuits and Binary Data

13:39
0:00-13:39
  1. Simon

    Until now, we have mainly discussed analog electronics. In an analog system, the typical values of components can be chosen from infinitely many possibilities. That flexibility is useful, but it also creates repeatability problems, because even small variations can affect the result.

  2. Maria

    Digital circuits approach the problem differently. They use a limited number of possible values, most commonly two logic states: high and low, or one and zero. Because there are fewer permitted states, digital systems are generally more resistant to disturbances and easier to reproduce consistently than analog systems.

  3. Simon

    The logic state of one digital element is called a bit. A single bit can represent only two states. But devices often have multiple inputs and outputs, so they can represent many combinations of states. Any number of bits considered together can be called a word, and a word can store information in binary form.

  4. Maria

    Each position in a binary word has a weight. We are used to decimal numbers, where every position uses one of ten digits, from zero through nine. For example, three decimal digits can represent one thousand combinations, because there are ten choices for each position.

  5. Simon

    Binary uses only zero and one, but the positions have powers of two as their weights. Starting at the right, the weights are 2 to the power of zero, then 2 to the power of one, then 2 squared, and so on. That gives weights of 1, 2, 4, 8, 16, 32, 64, and 128 as we move from right to left.

  6. Maria

    To convert a binary word into a decimal number, multiply each bit by its position's weight and add the results. A bit containing zero contributes nothing, while a bit containing one contributes its full weight.

  7. Simon

    For example, the binary representation of 103 uses the weights 64, 32, 4, 2, and 1. Adding them gives 64 plus 32 plus 4 plus 2 plus 1, which equals 103. In an eight-bit word, the 128-weight bit must be zero, because 128 is already greater than 103.

  8. Maria

    Another example is the binary word with ones in the positions weighted 128, 16, and 8. Adding those values gives 128 plus 16 plus 8, or 152. The other bit positions contain zero and therefore do not add anything.

  9. Simon

    To convert a decimal number into binary, repeatedly divide the number by two and record the remainder each time. For 152, the remainders, starting with the first division, are zero, zero, zero, one, one, zero, zero, and one. Reading those remainders from the last one back to the first gives 10011000.

  10. Maria

    A word with n bits can represent 2 to the power of n different combinations. So an eight-bit word has 256 possible combinations, from the all-zero value through the all-one value. This relationship becomes important when we discuss digital resolution later.

  11. Simon

    Two-state systems are described using Boolean algebra. Its most basic operations are logical product, logical sum, and negation. We can show the result of an operation for every possible input combination in a truth table.

  12. Maria

    The circuits that perform these operations are called logic gates. An AND gate performs conjunction, which is like multiplication: its output is true only when every input is true. An OR gate performs logical sum, and its output is true when at least one input is true.

  13. Simon

    A NOT gate performs negation. It changes true to false and false to true. More advanced gates are built from these basic ideas, including NAND, which is a negated AND, and NOR, which is a negated OR.

  14. Maria

    There is also the exclusive OR, or XOR, which represents an exclusive alternative, along with XNOR, the negation of XOR. These gates let digital circuits distinguish more specific combinations of input states.

  15. Simon

    Two useful logic circuits are multiplexers and demultiplexers. A multiplexer has many inputs and one output. Address lines identify the selected input, so the multiplexer can choose one data source and send its data along a single line.

  16. Maria

    A demultiplexer works in the opposite direction. It has one input and many outputs, and its address lines determine which output receives the data. In that way, a batch of data can travel on one line and then be directed to a specific destination.

  17. Simon

    Logic gates, multiplexers, and similar circuits are combinational systems. Their output depends only on the current logic states of their inputs. They do not use a previous internal state when determining the output.

  18. Maria

    More complex systems are called triggers, or sequential systems in this context. Their output depends not only on the inputs but also on the system's internal state. They can therefore memorize a current state, and they often have an additional input that synchronizes state changes with a clock signal.

  19. Simon

    As a circuit becomes more complex, directly connecting every required gate can produce a large and inefficient design. Karnaugh maps provide a basic method for optimizing Boolean functions, reducing the number of gates needed.

  20. Maria

    Before using a Karnaugh map, remember the notation. A true variable is written using its symbol, such as A. A false, or negated, variable is written with a negation, such as not A. A map contains the output value for every combination of input values.

  21. Simon

    The rows and columns of a Karnaugh map use Gray code. That means two neighboring labels differ in only one position. This arrangement makes it possible to group neighboring ones that differ in just one variable, allowing that changing variable to be eliminated from the simplified expression.

  22. Maria

    Imagine a device with three inputs, A, B, and C. There are eight possible input combinations, corresponding to the binary values zero through seven. We place the output value for each combination into an eight-cell Karnaugh map.

  23. Simon

    Suppose two neighboring cells containing ones differ only in A. Because the output is one whether A is zero or one, the group can be represented without A. If another pair depends only on B and C, that pair becomes a product involving those two variables. Combining the groups with OR produces a shorter Boolean equation.

  24. Maria

    The important principle is to make groups as large as possible while covering the required ones. Larger groups remove more variables, so the resulting equation is shorter and the final logic circuit needs fewer gates.

  25. Simon

    Karnaugh maps can also contain unknown or unused states. If a combination never occurs in the actual device, its output may be treated as either zero or one, depending on which choice gives better simplification.

  26. Maria

    For example, with two inputs A and B, suppose the only required one is the state represented by not A and B. The first expression is therefore not A AND B. But if an unused neighboring state can also be treated as one, the two cells form a group and the expression may simplify to just not A.

  27. Simon

    That is why treating an unknown state as one can reduce the number of logic gates. It is not changing a required output; it is using a don't-care state to create a larger group.

  28. Maria

    The same process works with four inputs, A, B, C, and D. Four inputs produce sixteen combinations, numbered from zero through fifteen. We place those values in a sixteen-cell Karnaugh map, again using Gray-code ordering for the row and column labels.

  29. Simon

    Then we group the positive states, including any useful unknown states. In the example, the groups produce terms represented by A AND B, plus not A AND not B AND not D, plus C. The optimized function can therefore be built with two AND gates feeding an OR gate, rather than a separate product term for every individual one.

  30. Maria

    This illustrates the practical purpose of Boolean optimization. We begin with a complete description of the output for every input combination, simplify the function using groups, and then construct the result from a smaller collection of gates.

  31. Simon

    When a design includes many gates, multiplexers, and memory elements, building the whole system from separate components can make it physically large and inefficient. Integrated digital circuits combine many functions into compact devices.

  32. Maria

    A microprocessor is a state machine that retrieves instructions from memory, decodes them, and executes them. Instructions are elementary actions, such as operating on data or making decisions based on the program's history.

  33. Simon

    The data involved may be values or addresses that identify information stored in memory. The processor receives an instruction, obtains the data required for that instruction, performs the operation, and produces a result.

  34. Maria

    Processor commands are kept as simple as possible. Moving or adding a bit can be done as a basic operation, while more complicated mathematical calculations must be performed step by step in the correct sequence. The processor carries out arithmetic using binary logic states.

  35. Simon

    Memory is the system used to store data. Depending on the memory type, information can be saved, read, and overwritten. Some types are designed to be written only once.

  36. Maria

    Memory is commonly divided into volatile and non-volatile types. Volatile memory, including RAM and cache, loses its stored data when the power is turned off. Non-volatile memory, including ROM and flash, retains data without power.

  37. Simon

    The two categories also involve a speed and capacity trade-off. Non-volatile memory is described here as cheaper but slower, while volatile memory is faster but, for the same price, may provide less capacity. In practice, non-volatile memory is useful for storing data, while fast volatile memory is useful for active calculations and operations.

  38. Maria

    Digital systems still need to interact with the analog world, where voltage and current vary continuously. Converters provide that connection. An analog-to-digital converter, or ADC, measures an analog quantity such as two volts and represents it with a binary signal.

  39. Simon

    A digital-to-analog converter, or DAC, performs the reverse operation. It takes a digital value and produces a corresponding voltage. Both types use a reference voltage, which defines the upper limit of the conversion range.

  40. Maria

    For a DAC, the reference voltage is the maximum output voltage when the maximum digital input value is applied. For an ADC, it is the maximum input voltage that corresponds to the maximum digital value. Exceeding the reference voltage can damage the system.

  41. Simon

    Sometimes the signal does not fit the converter's range. A seven-volt signal cannot be applied directly to a converter whose maximum input is five volts. Signal conditioning can adjust it, for example by using a voltage divider made from two resistors, such as 30 and 75 kilo-ohms.

  42. Maria

    Resolution tells us how many bits are used to represent the voltage. An eight-bit converter has 2 to the power of 8, or 256, possible states. More bits provide more possible levels and therefore allow smaller voltage differences to be represented.

  43. Simon

    For a ten-bit converter with a five-volt reference, the step size is approximately 4.88 millivolts. A digital value of zero represents zero volts, while a value of 512 is approximately halfway through the range and represents 2.5 volts.

  44. Maria

    Conversion also takes time. The time required for the converter to change an analog value into a digital one, or a digital value into an analog one, is called conversion time. Higher-resolution converters are often slower, so designers may need to balance accuracy against speed, although newer high-resolution and fast converters exist at a higher cost.

  45. Simon

    Consider a four-bit converter with a range from zero to five volts. It has about sixteen states, so each step represents approximately 5 divided by 16 volts, or 0.3125 volts. The digital word 0001 therefore represents about 0.3125 volts, while 0010 represents about 0.625 volts.

  46. Maria

    Processors, memories, and converters can be combined into a programmable system. If the hardware is designed properly, the same device can perform different operations depending on the instructions and data stored in memory, without changing its mechanical structure.

  47. Simon

    Those complete systems are called microcontrollers. A microcontroller combines a microprocessor system with memory and a broad set of peripherals. It is one of the largest families of digital integrated circuits.

  48. Maria

    Older microcontrollers had little memory and limited computing power. Modern, affordable microcontrollers are much faster, include considerably more memory, and offer many useful peripherals. That makes it practical to build programmable electronic devices without assembling every processor, memory, and interface circuit separately.

  49. Simon

    So the main journey has taken us from the repeatability of digital logic, through bits, binary numbers, Boolean gates, multiplexers, triggers, and Karnaugh-map optimization, and then to processors, memory, converters, and microcontrollers.

  50. Maria

    And that gives us the foundation for the next step: applying electronics in practice. The next episode will focus on working safely, handling workshop tools, and beginning the design of our own electronic devices.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent