We have already seen how to convert Hexadecimal digit to its ASCII equivalent. In this section, we will see how to convert two-byte (4-digit) Hexadecimal number to ASCII. Each nibble of these numbers is converted to its ASCII value.We are using one subroutine to convert a hexadecimal digit to ASCII. In this program, we are calling the subroutine multiple times.In the memory, we are storing 2-byte Hexadecimal number at location 20H and 21H. After converted ASCII values are stored at location 30H to 33H.The hexadecimal number is 2FA9H. The ASCII equivalent is 32 46 41 39.AddressValue...20H2FH21HA9H...30H00H31H00H32H00H33H00H...Program MOVR0, ... Read More
This is one of the methods of representing signed integers in the computer. In this method, the most significant digit (MSD) takes on extra meaning.If the MSD is a 0, we can evaluate the number just as we would interpret any normal unsigned integer.If the MSD is a 1, this indicates that the number is negative.The other bits indicate the magnitude (absolute value) of the number.If the number is negative, then the other bits signify the 1's complement of the magnitude of the number.Some signed decimal numbers and their equivalent in 1's complement notations are shown below, assuming a word ... Read More
If a method is declared as static, it is a member of a class rather than belonging to the object of the class. It can be called without creating an object of the class. A static method also has the power to access static data members of the class.A static variable is a class variable. A single copy of the static variable is created for all instances of the class. It can be directly accessed in a static method.An abstract class in Java is a class that cannot be instantiated. It is mostly used as the base for subclasses to ... Read More
Here we will see how to subtract two 8-bit numbers using this microcontroller. The register A(Accumulator) is used as one operand in the operations. There are seven registers R0 – R7 in different register banks. We can use any of them as the second operand.We are taking two number73H and BDH at location 20H and 21H, After subtracting the result will be stored at location 30H and 31H. AddressValue...20H73H21HBDH...30H00H31H00H...ProgramMOVR0, #20H;set source address 20H to R0 MOVR1, #30H;set destination address 30H to R1 MOVA, @R0;take the value from source to register A MOVR5, A; Move the value from A to ... Read More
Now we will try to multiply two 8-bit numbers using this 8051 microcontroller. The register A and B will be used for multiplication. No other registers can be used for multiplication. The result of the multiplication may exceed the 8-bit size. So the higher order byte is stored at register B, and lower order byte will be in the Accumulator A after multiplication.We are taking two number FFH and FFH at location 20H and 21H, After multiplying the result will be stored at location 30H and 31H. AddressValue...20HFFH21HFFH...30H00H31H00H...Program MOV R0, #20H;set source address 20H to R0 ... Read More
No, we cannot override private or static methods in Java.Private methods in Java are not visible to any other class which limits their scope to the class in which they are declared.ExampleLet us see what happens when we try to override a private method − Live Democlass Parent { private void display() { System.out.println("Super class"); } } public class Example extends Parent { void display() // trying to override display() { System.out.println("Sub class"); } public static void main(String[] args) { Parent obj = new Example(); ... Read More
Now we will see another arithmetic operation. The divide operation to divide two 8-bit numbers using this 8051 microcontroller. The register A and B will be used in this operation. No other registers can be used for division. The result of the division has two parts. The quotient part and the remainder part. Register A will hold Quotient, and register B will hold Remainder.We are taking two number0EH and 03H at location 20H and 21H, After dividing the result will be stored at location 30H and 31H. AddressValue...20H0EH21H03H...30H00H31H00H...ProgramMOV R0, #20H;set source address 20H to R0 MOV R1, #30H;set destination address ... Read More
Forward error correction (FEC) is an error correction technique to detect and correct a limited number of errors in transmitted data without the need for retransmission.In this method, the sender sends a redundant error-correcting code along with the data frame. The receiver performs necessary checks based upon the additional redundant bits. If it finds that the data is free from errors, it executes error-correcting code that generates the actual frame. It then removes the redundant bits before passing the message to the upper layers.Advantages and DisadvantagesBecause FEC does not require handshaking between the source and the destination, it can be ... Read More
Here we will see how 8279 Chip can be used to interface a matrix keyboard with 8085 microprocessors. This chip can be used either keyboard/display interfacing mode or as a strobed input port. But generally, it is used as keyboard interfacing.The keyboard interfacing schemes can also be divided into two modes. These modes are Decoded mode of operationEncoded mode of operationDecoded Mode of OperationIn this mode, the matrix keyboard can have only four rows. These four rows can be selected by using SL3-0 select lines. There are eight columns. These can be selected using RL7-0 these eight column lines. So there are ... Read More
Create a SimpleDateFormat object −SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss");Do not forget to import the following package for SimpleDateFormat class −import java.text.SimpleDateFormat;Now, since we have set the format for date above, let us parse the date using parseObject() method −Date dt = (Date) dateFormat.parseObject("2018.11.22.11.50.15");The following is an example −Example Live Demoimport java.util.Date; import java.text.SimpleDateFormat; public class Demo { public static void main(String[] argv) throws Exception { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy.MM.dd.HH.mm.ss"); // parse System.out.println("Parse Date and Time..."); Date dt = (Date) dateFormat.parseObject("2018.11.22.11.50.15"); System.out.println(dt); } }OutputParse ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP