 Asalaamu alaikum students, I am Vasim Ekram. I would be teaching digital logic design course. This is the first lecture in a series of 45 lectures on this course. In the first part of today's lecture, I would be giving a brief overview of the course and in the later half of the lecture I would be discussing the number systems. So let us start by discussing analog values, digital values and their electronic representation. Most of the quantities that we can measure in nature are continuous in nature. For example, the intensity of light, temperature and velocity all are continuous. If you, for example, heat a pan of water, the temperature continuously or gradually rises to 100 degrees centigrade. It never rises in steps, for example 30 degrees to 40 degrees to 50 degrees. Digital values on the other hand are discrete set of values representing the continuous signal. So let us see what is a continuous signal and how do we represent it in the form of discrete values. The diagram shows a plot of temperature continuously varying with time. The continuous signal might be representing the change in intensity of light or velocity. The continuous signal can be represented digitally by taking samples at regular but fixed intervals. In the next diagram, we take 15 samples at regular time intervals. The 15 samples having the values 1, 2, 4, 7, all the way up to 22 represent the continuous signal digitally. The digital representation of the continuous signal only approximates the original signal and does not truly represent the original signal as can be seen by plotting the digital values. The reconstructed continuous signal does not give an exact replica of the original. The reconstructed signal has sharp edges and corners in contrast to the original signal which has smooth curves. If the number of samples that are collected are reduced by half that is samples are collected at every odd interval of time. The resulting reconstructed signal is very different from the original signal. The peak in the continuous signal at 34 degrees centigrade and the dip at 23 degrees centigrade are all together missing from the reconstructed signal. This is due to the small number of samples taken. A better approximation of the original signal can be obtained by increasing the number of samples. An infinite number of samples very accurately represent the original continuous signal. In the last slide, we saw a continuous signal and its digital representation. These digital values have to be processed electronically by a digital system. Generally, there are two types of electronic systems analog systems and digital systems. Analog systems process continuous signals. So, a continuous quantity has to be converted into electrical or voltage terms. So, for example, a continuous signal of 42 degrees centigrade would be represented by perhaps 42 millivolts. A continuous temperature signal of 37.53 degrees would be represented by 35.73 millivolts. Digital systems as I have said before use digital or discrete values. So, are we going to be representing these discrete values in terms of voltages? Let us see. Consider a calculator which is an example of a digital system. Let us assume that the calculator has been internally calibrated to represent the number 1 by 1 millivolts. Thus, a number or temperature value such as 39 is represented by the calculator in terms of a voltage value 39 millivolts. Calculators can also handle a large value such as 6.2510 raised to power 18, the number of electrons in one coulomb of charge. This large value represented in terms of voltage by the calculator turns out to be 6.2510 raised to power 15 volts, which is a very large voltage value and cannot be practically represented by any circuit. In the last slide, we saw that it is not practical to represent discrete digital values in terms of voltages in a digital system. Basically, digital systems are based on two voltage values or rather they work with two voltage values, plus 5 volts which represents the logic high state or logic one state, 0 volts which represents the logic low state or logic zero state. Using these two voltage values or these two states, we can represent any quantity which has two states or two values, for example, numbers 0 and 1, the color black and white, the temperature hot and cold. An object might be moving or stationary, so just two values. How can we represent multiple values or more than two values in a digital system? Well, digital systems are based on binary number systems. A single digit or a bit of binary number system can represent only two values, a 0 and a 1. To represent large values, we combine these bits. So, a combination of two bits would allow us to represent four different values or four quantities. Normally, you have been doing this in decimal number systems. A single digit in the decimal number system can represent up to 10 values from 0 to 9. How do you represent more than 10 values? Well, you use a combination of two decimal digits. So, two digits would allow you to represent up to 100 values from 0 to 99. Similarly, in a binary number system, you combine a number of binary bits to represent multiple values. So, as I have said before, two bits would allow you to represent two, rather four quantities. That could be four colors, four shades of gray between the color white and black. The number 39 can be represented by a combination of six bits. So, in terms of binary, 39 is equal to a combination of 1, 0, 0, 1, 1 and 1. Now, as we have said before, in a digital system, the numbers are represented, the binary numbers are represented in the form of voltages. So, the number 39 would be represented in terms of voltages as 5 volt, 0 volt, 0 volt, 5 volt, 5 volt and 5 volt. Let's have a look at the merits of a digital system. Digital systems are extensively being used. They offer a number of advantages compared to analog systems. So, let us have a look at few of those advantages. The first and the main advantage of a digital system is that the processing and storage of digital data is very efficient. Computers, for example, are very efficient at processing information that is in digital binary form. In fact, computers work with digital information. Another example, a CD can store large number of digitized audio and video clips. Storing the same number of audio or video clips in an analog form would require a large number of audio or video cassettes. Secondly, transmission of digital data is efficient and reliable and less prone to errors. Even if an error occurs, detection and correction of errors in digital data is easier. We will be looking at a simple example of detecting errors using the parody-beth method. Digitally stored data can be precisely and accurately reproduced. For example, the picture quality and sound quality of digitized video or audio stored on CDs can be reproduced with a far superior quality as compared to analog, audio and video. Digital circuits and systems are easier to design and implement. We would be looking at some simple digital systems in the digital logic design course. Digital circuits in the form of integrated circuits occupy a very small space. For example, the PC has a motherboard which has an area less than 1 square foot. This motherboard has all the important circuitry of the computer. Digital memory, on the other hand, is implemented as an integrated circuit. It is small enough to fit in the palm of your hand, but it can store an entire collection of books. In the last slide, we looked at several advantages of a digital system. You would be learning more about digital systems in the course. Let us look at the type of information which a digital system can process. Digital systems can very easily handle numbers. They can perform different arithmetic operations on those numbers. They can very easily handle text. You must have typed a number of documents, edited a number of documents on your computer. You can use symbols to write equations. Computers or rather digital systems are good at processing pictures, diagrams and video clips. Computers can also easily handle sound tracks. All these different types of information are represented in terms of binary numbers. Of course, different standards and formats are used to represent these different quantities. We have been talking about digital systems, binary numbers and their electronic representation. How does a digital circuit actually process all these different types of information? Well, the basic building block of any digital circuit is the logic gate, the digital logic gate. A logic gate performs a unique operation. The output would depend on the inputs applied. There are three logic gates which are commonly used, the AND gate, the OR gate and the NOT gate. There are four other logic gates which are again commonly used in digital circuits. The four gates are the NAND gate, the NOR gate, the EXCLUSIVE OR gate and the EXCLUSIVE NOR gate. All these seven gates are implemented in the form of integrated circuits and they are available for designing or implementing digital circuits. Let's have a look at these logic gates. These gates are represented by symbols. Each gate except for the NOT gate is shown to have two inputs at the left-hand side. The six gates excluding the NOT gate can have more than two inputs. All logic gates always have a single output. The integrated circuit shows a NAND gate IC which has four dual input NAND gates. Such ICs with different gates are available and used for implementing digital circuits. The seven logic gates which we have just discussed are not able to perform any useful function by themselves. They have to be combined together to form a circuit. Circuits in which we have a combination of such gates is known as a combinational logic circuit. Consider the example of an adder combinational circuit. An adder combinational circuit is able to add two binary numbers and give an output which is of course the sum of two binary numbers. The adder combinational circuit or rather the adder circuit uses AND gates, OR gates and exclusive OR gates. An adder circuit is formed by the combination of AND or an exclusive OR gates and is able to add two single bit binary numbers. Combinational circuits perform an operation on the input binary information and result in an output which is almost instantaneous. Many of these combinational circuits that perform specific functions such as addition are available as MSI or medium scale integrated circuits and are known as functional devices. Digital systems are used in a vast number of applications. The output of these digital systems not only depends on the current input but some previously stored information. Take the example of a counter which counts down from 10 to let us say 0. The initial value stored in the counter is the number 10. It receives an input signal which could be in the form of a pulse. On receiving the signal it decrements the previously stored information which is 10 to 9. So the new output is 9. Such a digital circuit which changes its output based on the new current input and some previous input is known as a sequential circuit. Sequential circuits are basically a combination of combinational circuits and a memory element. The number 10 which was stored in the digital system is in fact stored in that memory element. Let us have a look at the block diagram of a sequential circuit and let us explain how it works. The block diagram of a sequential circuit is shown as I mentioned before. It is composed of two parts the combinational logic circuit and the memory element. In the diagram you see a single input and a single output. The output from the combinational logic circuit is attached to the input of the memory element and the output of the memory element is attached to another input of the combinational logic circuit. Consider the timer of a microwave oven. You key in the time to cook your favorite dish the microwave display unit displays the cooking time. The memory element of the microwave oven sequential circuit stores the cooking time. The cooking time is decremented by one after every second when a new input signal is received at the input of the combinational part of the sequential circuit. Ultimately when the cooking time decrements to zero and the memory element stores zero the next input signal sounds and alarm and turns the microwave off. Similarly a traffic signal controller operates in a similar manner. It switches between the green amber and red signal in a sequence on the basis of current and previous information. The memory or storage element in a sequential circuit is implemented using a very simple digital circuit known as a flip-flop. The memory element in a sequential circuit is implemented by using a very simple digital circuit known as a flip-flop. We would be of course talking about flip-flops in the course. Other simple examples of sequential circuits are counters and timers and registers which again we would be discussing in the course. Programmable logic devices or PLDs. Up till now we have been saying that sequential circuits and combinational circuits are made up by combining or connecting together different logic gates and memory elements. PLD or PLDs provide a general purpose hardware. PLDs are available in integrated circuit forms. A user can program these PLD devices to implement any function. For example, the Adder Combination Circuit which we discussed earlier is a combination of AND gates, OR gates and exclusive OR gates. Basically three different types of integrated circuits or three different chips. The same Adder Circuit can be implemented through a single PLD device. So we have simply reduced the cost instead of having three different ICs maintaining an inventory of three different ICs. We only have a single PLD device. So the cost goes down. PLD is flexible. You can implement any combinational or sequential circuit. The design time and the implementation time also reduces. We would be talking about PLD devices in the course. Memory is another essential element of a digital system. We mentioned a flip-flop or a memory element which is an essential part of a sequential circuit. Memory generally is required to store data. In a computer there are two types of memories. A random access memory or RAM which allows the system to either read or write information from the memory. The memory is volatile. That means if the power is turned off, the contents or the information stored in the memory is lost. It must have happened to you when you're sitting on a computer typing something or writing a program and the power goes off. When the power is restored, you have lost that last portion which you did not save because that particular document or piece of code was in the RAM. The other memory is the random or rather read-only memory or ROM. ROM only allows the system to read information from it. You cannot write something into ROM. Usually ROMs are pre-programmed by the manufacturer and they contain important code. When the power goes off, the contents of ROM remain there. So, when you switch back the power, you would see the same contents of the ROM. So, again we would be talking about RAM and ROM memories and their configuration, how digital systems are able to read or write to RAM and how systems are able to read from ROM. The last topic that we would be discussing in the course is A2D converters and D2A converters. As we mentioned earlier, most of the quantities that we can measure are continuous. So, if you are going to be using a digital system to control a machine or an industrial plant, then you need to convert the analog or continuous signals into digital signals so that they can be processed by the digital controller or digital processor. In most of the cases, the output of the digital system has to be converted back into the analog form. So, basically two types of conversions are taking place. The input continuous signal, the real world signal is being digitized or changed into digital values which can be processed by the digital processor controller. The device which converts analog signals into digital signals is known as the analog to digital converter. The output of the digital controller, which is of course in the digital form, has to be converted into the analog form. The device which converts these digital signals back into the analog form is the D2A or digital to analog converter. Let us take an example of an industrial plant. In the diagram, we see a chemical reaction vessel in which a chemical reaction is taking place. The vessel is being heated to expedite the reaction, the chemical reaction taking place inside. The temperature of the vessel has to be continuously monitored so that the temperature does not go beyond a certain limit. Similarly, if the temperature of the chemical reaction falls below a certain limit, the heat has to be increased. Let us have a look at the diagram and see how the analog values are going to be converted into digital values processed by a digital controller and then the digital controller generated digital values are going to be converted back into the analog form. The diagram shows a reaction vessel inside which the chemical reaction is taking place. The vessel is being heated by some form of a heater. A thermocouple, basically a device which converts temperature into corresponding analog voltage values. An A2D converter which converts the analog voltage representing the temperature of the vessel to the digital format. The digital controller is going to process the digital value converted by the A2D converter. The digital controller is going to generate some form of digital output. The digital output is going to be converted back into an analog voltage by the D2A converter. This analog voltage is going to be connected to the heater control. So through this voltage, we are either going to increase the amount of heat provided to the reaction vessel or decrease the amount of heat provided to the reaction vessel. So the temperature of the vessel is monitored to control the chemical reaction. As the temperature of the vessel rises, the heat has to be reduced by a proportional level. An electronic temperature sensor converts the temperature into an equivalent voltage value. The voltage value is continuous and proportional to the temperature. The voltage representing the temperature is converted into a digital representation which is fed to a digital controller circuit. The circuit generates a digital value corresponding to the desired amount of heat. The digitized output representing the heat is converted back to a voltage value which is continuous and is used to control a valve that regulates the heat. An A2D converter converts the analog voltage value representing the temperature into the corresponding digital value for processing. A D2A converter converts back the digital heat value to its corresponding continuous value for regulating the heater. Analog to digital converters and digital to analog converters are an essential part of a digital system. They provide us with an interface between the real world and the digital world. We would be discussing both these converters. Let us now summarize the topics which we have discussed. We started with a continuous value. We set most of the values which we can measure are continuous in nature. They have to be converted into the digital form so that they can be processed by digital systems. The digitized values are represented in the form of binary numbers. Binary numbers are stored in the form of voltages, 5V and 0V within a digital system. We talked about different merits and advantages of a digital system. We also mentioned the different types of information which a digital system can process. Of course, all those different types of information has to be represented in a binary form. Next, we talked about how we are going to be processing the binary information in a digital system. The basic digital circuit is the logic gate. Each logic gate is able to perform a unique operation. There are about 7 different logic gates which are considered to be the building blocks of a digital circuit. We next mentioned that a digital gate by itself cannot perform a useful function. Several gates have to be connected together or combined together to form a combinational circuit. The other form of digital circuit is the sequential circuit which has a memory element. It is able to generate an output based on the current input and some previously stored information. Next, we talked about PLDs or Programmable Logic Devices. Instead of implementing combinational circuits and sequential circuits by connecting different gates, you simply program a general purpose device. The cost reduces and there are other advantages. We talked about memory. Memory basically is essential in a digital system because you have to store information. There are two types of memories, RAM and ROM. And the last topic which we discussed was A2D Converters and D2A Converters. Basically, they allow us to interface with the real world. I have just given a brief overview of the course. Let us now start with the second part of our lecture, the number systems. We have been using the decimal number system since our early school days. We know that in a decimal number system, we have 10 unique numbers or symbols representing 10 unique values. So, the number 0, 1, 2, up till 9 represent 10 different values. To represent larger numbers in the decimal number system, you use a combination of digits. So, for example, you need to represent a value larger than 9. What do you do? You use a combination of two digits. So, 1 and 9, two digits represent a value 19. So, generally two digits would allow you to represent 100 different values starting from 0 up to 99. Similarly, even larger values can be represented by combining more digits. The decimal number system is a positional number system. The least significant digit of a decimal number has the weight 1. The next digit has the weight 10 and as you keep on moving towards the left, the weight increases by a factor of 10. So, you have unit 10, 100 and 1000. Consider the number 275. Now, the number 2 is less than 5 and 7, but since the position of number 2 has the weight 100, therefore, 2 signifies 200. 5 is at the unit place, so its weight is 5. 7 is in the 10 place, so the weight is 70. Let us have a look at how we can represent these decimal numbers in the form of their weights and base number. The number 275 can be written as 2 into 10 power 2 plus 7 into 10 power 1 plus 5 into 10 power 0. The number 10 represents the base or radix of the number system. Since it is a decimal number system, so it is base 10 number system. 10 raised to power 2, 10 raised to power 1, 10 raised to power 0 represents the weights of the 3 digits. So, the weights are 100, 10 and 1. Fractions can be represented in decimal number system in a manner similar to that of representing integers. The weight of the digit to the immediate right of the decimal point has a weight 10 raised to power minus 1. Weights of subsequent digits decrease by a factor of 10 as you move towards the right. Thus, 382.91 can be written in terms of the base number and weights as 3 into 10 power 2 plus 8 into 10 power 1 plus 2 into 10 power 0 plus 9 into 10 power minus 1 and plus 1 into 10 power minus 2. Now, if you solve this expression, you get 5 terms 300, 80, 2.9 and 0.01. 0.9 and 0.01 represent the terms after the decimal point, the fraction. If you sum up all these values, you get the result 382.91. I hope you have understood the decimal number system. You have been using this since your school days. Let us consider another number system, a hypothetical number system. Let us suppose a cave has been discovered by some archaeologists. Inside the cave, they have discovered that the caveman has been using a number system. Five symbols uniquely represent the numbers 0, 1, 2, 3 and 4. What is the number system being used by the caveman? Can you guess? Well, the number system is base five number system because there are five unique symbols. How can the caveman represent large values using this base five number system? Let us have a look at the base five number system used by the caveman. The number system discovered by the archaeologists in a prehistoric cave shows five symbols used by the caveman to represent numbers. The symbols are sigma, delta, greater than, omega and arrow. These five symbols represent decimal numbers from 0 to 4 respectively. The number delta, omega, arrow and sigma in base five represent the number 220 in decimal. Let us see how delta, omega, arrow and sigma represent 220 in decimal. The caveman can represent the first five numbers that is from 0 to 4 using a single digit of the caveman number system. So, sigma, delta, greater than, omega and arrow represent decimal numbers 0 to 4. To represent the number 529, the caveman uses a combination of two digits. The most significant digit is set to delta whereas the least significant digit varies from sigma to arrow. This is something similar to what we do in a decimal number system. We use a single digit to count from 0 to 9. When we need to count from 10 to 19, what do we do? The second digit is set to 1 whereas the least significant digit varies from 0 to 9. So, this can be seen from the table. The first 20 decimal numbers are represented by a combination of the base five number system. The number delta, omega, arrow, sigma can be easily converted into decimal if we write an expression for the caveman number in terms of the base number and the weights. Thus, the four digit number used by the caveman can be written as, in the form of an expression, delta into 5 power 3 plus omega into 5 power 2 plus arrow into 5 power 1 and finally, sigma into 5 power 0. The weights of the four digits starting from the most significant digits are 125, 25, 5 and 1. As you can see, the weights are changing by a factor of 5. Why 5? Well, as we mentioned earlier, the caveman is using base five number system. Multiplying the weights by the corresponding decimal equivalents of the caveman numbers results in 220. The caveman number system, as we have seen, is a base five number system. The decimal number system was a base ten number system. I hope you can now handle different number systems. Digital systems, as we spoke earlier, use a binary number system. Binary number system, as we had said earlier, represents only two values. A digit of a binary number system represents only two values, a zero and a one. If you need to represent large numbers in the binary number system, you need to combine several bits. Just like the decimal number system or the base five number system. Let us see how binary numbers can be used to represent decimal numbers. As we said earlier, a single binary bit can represent only two decimal values, a zero and a one. To represent the next two decimal values, two binary bits are used. The most significant bit remains fixed at one and the least significant bit changes between zero and one. Thus, the decimal numbers two and three are represented by a combination of two bits each. The number two is represented by binary one zero. The number three is represented by binary one one. The decimal numbers four and five are represented by a combination of three bits. The most significant two bits remain fixed and the least significant bit changes between zero and one. Thus, the decimal four is represented by one zero zero binary and number five is represented by one zero one binary. The binary representation of the first twenty decimal numbers from zero to nineteen is shown in the table. The decimal equivalent of a combination of binary numbers can easily be found by writing an expression in terms of the base value and weights. The binary combination one zero zero one one represents decimal nineteen. The subscript two indicates that the number one zero zero one one is binary and not decimal ten thousand and eleven. Writing the expression gives us one into two power four plus zero into two power three plus zero into two power two plus one into two power one and plus one into two power zero. The weights of the five bits starting from the left most significant bit are sixteen, eight, four, two and one. The weights in a binary number system increase by a factor of two starting from the right most least significant digit. In the decimal number and the caveman number system the weights increased by a factor of ten and five respectively. Multiplying the weights with the respective decimal equivalents of the binary values results in five terms. Sixteen, zero, zero, two and one which adds up to nineteen. Binary numbers can be used to represent integers and fractions. Calculating the decimal equivalent of a binary number representing a fraction can easily be done by writing the expression in terms of the base value and the weights as we have been doing. Thus the number one zero one one point one zero one is equivalent to decimal eleven point six two five in the decimal number system. Let us see how. Writing the binary number one zero one one point one zero one in the form of an expression gives us one into two power three plus zero into two power two plus one into one into two power one plus one into two power zero plus one into two power minus one plus zero into two power minus two and the final term is plus one into two power minus three. The weights of the binary numbers are eight, four, two, one, one and a half, one and a quarter and one by eight. The weights of the fraction part of the binary number decrease by a factor of two starting from the bit immediately to the right of the decimal point. Now multiplying the weights with the corresponding decimal equivalents of the binary bits results in the terms eight, zero, two, one, zero point five, zero and zero point one, two, five. All these terms add up to give eleven point six two five. One final word on representing fractions in binary number system. As we have seen we can represent fractions in terms of binary numbers. Practically digital circuits or digital systems do not represent binary fractions in this particular format. Floating point notations are used. We would be talking about floating point notations to represent fractions in binary. Let us just recap on the three number systems which we have just discussed. We talked about the decimal number system. You have been using this decimal system. It is a base ten number system. We have talked about the caveman number system. It is a base five number system. The binary number system is a base two number system. Digital systems are based on this binary number system. To represent the decimal equivalent of any value represented in any of these three number systems, you adopt the following method. You just write an expression using the base number of the number system and its weights. You simply add up the weights multiplied by the corresponding number and you end up with the actual number in decimal. In the real world we are dealing with numbers which are represented in decimal. Whereas in the digital system we are dealing with numbers which are of course represented in binary. So we need to regularly convert between decimal and binary and vice versa. So you have to be able to change or convert a decimal number 379 into its equivalent binary. Similarly, a fraction represented in binary needs to be converted back into decimal. There are different methods to change from one number system to another. Now let us see how you would be converting from a binary number to decimal. We have already been doing that. You write an expression in terms of the base value of the number system and its weights. If you add up all the sum terms you get a decimal equivalent. A faster, a quicker method to convert binary into decimal would be to add only those terms which have a binary value of 1. All binary digits having 0 are not counted. We are going to be looking at the example. How would you be converting from decimal to binary? Again there are several methods which can be used. One method would be to use repeated division. You have a decimal number, you need to convert it into binary. Just keep on dividing that number by 2. You would be getting quotient values and remainders. Once you completely divide the decimal number you have the answer in binary. Again we are going to be looking at the method. Another method is the sum of weight method used in reverse. Let us have a look at all these methods which we have described. First we would be looking at the conversion from binary to decimal and then we would be looking at methods used to convert from decimal to binary. Converting from binary to decimal. We have been already doing this conversion. The method used is sum of weights method. You write the binary number in the form of an expression using the base 2 and the weights of the corresponding binary numbers. You sum up the terms and the result is the decimal number. A simpler method is to add weights of only the non-zero terms. Consider an example. 1 0 0 1 1 is a binary number. Now you know that the weights of binary digits increase or decrease by a power of 2. So 1 the most significant digit has the weight 16. The next two binary digits 0 and 0 are not accounted for and the last two binary digits 1 and 1 have a weight of 2 and 1 respectively. So if you add up the weights 16, 2 and 1 the result is 19. Let us consider another example. A binary number representing an integer path and a fraction. So 1 0 1 1 0 1 is the binary number. The most significant bit which is a 1 has the weight 8. The next digit is binary 0. So it is not accounted for. The next two bits are both 1s and their corresponding weights are 2 and 1 respectively. There are three digits after the decimal point. The right most digit after the decimal point is a 1. It has the weight 0.5. The next digit is a 0. Its weight is not accounted for and the last digit has the weight 1 by 8. So if you add all the five terms 8, 2, 1, 1.5 and 1 by 8 the result is 11.625. Now this particular conversion can be performed mentally. You do not need to write an expression. You simply consider the weights of digits having the value 1. This of course can be used for small numbers. You cannot use this mental arithmetic to calculate decimal values for large binary numbers. For large binary numbers you would have to write a proper expression. Let us consider the decimal to binary conversion. As we have said that two different methods can be used. Some of weights method used in reverse and the repeated division by 2. Let us consider the first method. Some of weights used in reverse. Consider the number 392 of course represented in decimal. This has to be converted into binary. Using the sum of weight method the highest weight which is smaller than 392 is 256. So you mark a 1. You subtract 256 from 392 which results in 136. Now you go on to the next smaller weight. So the next smaller weight after 256 is 128 which is again smaller than 136. So you mark another 1. You subtract 128 from 136 the result is 8. Now you compare the number 8 with successive lower weights. So the next lower weight after 128 is 64 it is larger than 8. So you mark a 0 after the two ones. The next smaller weight is 32 which is still larger than the number 8. So you mark another 0. You go on to the next smaller weight which is 16 which is again larger than 8. So you mark another 0. Now you have a term which has 1, 1, 0, 0, 0. Now the next smaller weight after 16 is 8 which is equal to the number remaining which is of course 8. So you mark a 1. Remaining weights that is 4, 2 and 1 are not required. So you simply put 3 zeros. So you have ended up with a binary number 1, 1, 0, 0, 0, 1, 0, 0, 0 which is the representation of decimal 392. The example which you just saw was the sum of weights method in reverse. It was of course used to convert a decimal number into binary. In the next lecture we would be looking at the division by two method. Today we discussed the number systems. You should practice with different number systems. So you can quickly convert from one number system to another. You should be thinking in terms of binary numbers. We will be continuing with the number system in our next lecture. Khuda hafiz and assalamu alaikum.