Arithmetic Group in 8051

Ankith Reddy
Updated on 27-Jun-2020 13:07:25

13K+ Views

In 8051 Microcontroller there are 24 different instructions under the Arithmetic Group. In total there are 64 opcodes. The Carry Flag (CY), Auxiliary Carry (AC)and Overflow flag (OV) are affected based on the result of ADD, ADDC, SUBB  etc. instructions. The multiple and divide instructions clear the Carry flag, and also does not affect the AC flag. After execution of multiplication, the OV flag will be 1 when the result is greater than FFH. Otherwise, it is 0. Similarly, after division OV flag is 1 when the content of B is 00H before division, otherwise it is 0. The DA ... Read More

List Short Weekday Names in Java

karthikeya Boyini
Updated on 27-Jun-2020 13:07:02

451 Views

To list short weekday names, use the getShortWeekdays() from the DateFormatSymbols class in Java.DateFormatSymbols is a class for encapsulating localizable date-time formatting data.Get short weekday names in an arrayString[] days = new DateFormatSymbols().getShortWeekdays();Display the weekdayfor (int i = 0; i < days.length; i++) { String weekday = days[i]; System.out.println(weekday); }The following is an example −Example Live Demoimport java.text.DateFormatSymbols; public class Demo {    public static void main(String[] args) {       String[] days = new DateFormatSymbols().getShortWeekdays();       for (int i = 0; i < days.length; i++) {          String weekday = days[i];          System.out.println(weekday);       }    } }OutputSun Mon Tue Wed Thu Fri Sat

Logical Group in 8051

George John
Updated on 27-Jun-2020 13:06:59

7K+ Views

In 8051 Microcontroller there is 25 different instructions under the Logical Group. In total there are 49 opcodes. The Carry Flag (CY) affects only by instruction RRC and RLC.In the following table, we will see the Mnemonics, Lengths, Execution Time in terms of the machine cycle, Number of Opcodes etc.MnemonicsByte CountExecutionTimeOpcode CountANL A, Rn118ANL A, a8211ANL A, @Ri112ANL A, #d8211ANL a8, A211ANL a8, #d8321ORL A, Rn118ORL A, a8211ORL A, @Ri112ORL A, #d8211ORL a8, A211ORL a8, #d8321XRL A, Rn118XRL A, a8211XRL A, @Ri112XRL A, #d8211XRL a8, A211XRL a8, #d8321CLR A111CPL A111RL A111RLC A111RR A111RRC A111SWAP A111ExamplesSr.NoInstruction & Description1ANL A, R5This is ... Read More

Display Time in 24-Hour Format in Java

karthikeya Boyini
Updated on 27-Jun-2020 13:05:35

4K+ Views

Use the SimpleDateFormat class to display time in 24-hour format.Set the formatDate dt = new Date(); SimpleDateFormat dateFormat; dateFormat = new SimpleDateFormat("kk:mm:ss");Now, the following will display time in 24-hour formatdateFormat.format(dt)The following is an exampleExample Live Demoimport java.text.SimpleDateFormat; import java.util.Date; public class Demo {    public static void main(String[] argv) throws Exception {       Date dt = new Date();       SimpleDateFormat dateFormat;       dateFormat = new SimpleDateFormat("kk:mm:ss");       System.out.println("Time in 24 hr format = "+dateFormat.format(dt));    } }OutputTime in 24 hr format = 11:40:52

Bit Processing Group in 8051

Chandu yadav
Updated on 27-Jun-2020 13:04:59

4K+ Views

In 8051 Microcontroller there is 17 different instructions under the Logical Group. In total there are 17 opcodes. The Carry Flag (CY) acts like the single-bit accumulator in different bit processing instructions.In the following table, we will see the Mnemonics, Lengths, Execution Time in terms of the machine cycle, Number of Opcodes etc.MnemonicsByte CountExecution TimeOpcode CountCLR C111CLR bit211SETB C111SETB bit211CPL C111CPL bit211ANL C, bit221ANL C, /bit221ORL C, bit221ORL C, /bit221MOV C, bit211MOV bit, C221JC rel221JNC rel221JB bit, rel321JNB bit, rel321JBC bit, rel321ExamplesSr.No Instruction & Description1CLR CThis instruction is used to clear the carry flag to 0.2SETB 0D5HThis instruction of type SETB ... Read More

Unsigned Binary Integers

Ankith Reddy
Updated on 27-Jun-2020 13:04:39

5K+ Views

Unsigned binary integers are numbers without any ‘+’or ‘-’ sign. Here all bits representing the number will represent the magnitude part of the number only. No bits will remain reserved for sign bit representation. An unsigned binary integer is a fixed-point system with no fractional digits.Some real life Examples are −Number of tables in a class, The number of a member of a family.Obviously, they are unsigned integers like 10 and 5. These numbers have to be represented in a computer using only binary notation or using bits.Numbers are represented in a computer using a fixed size, like 4, 8, ... Read More

Feedback-Based Flow Control in Data Link Layer

Nitya Raut
Updated on 27-Jun-2020 13:03:04

2K+ Views

Flow control is a technique that allows two stations working at different speeds to communicate with each other. It is a set of measures taken to regulate the amount of data that a sender sends so that a fast sender does not overwhelm a slow receiver.In data link layer, the sender continues to send frames only after it has received acknowledgments from the user for the previous frames. This is called feedback based flow control. Here, a restriction is imposed on the number of frames the sender can send before it waits for an acknowledgment from the receiver.Feedback based Flow ... Read More

Format Date with SimpleDateFormat in Java

Samual Sam
Updated on 27-Jun-2020 13:02:02

285 Views

The SimpleDateFormat class is used to parse and format dates. To create an object, firstly import the following packageimport java.text.SimpleDateFormat;Set the dateString strDate = "'Year = '"; strDate += "yyyy"; strDate += "'Month = '"; strDate += "MMMMMMMMM"; strDate += "'Hours = '"; strDate += "hh"; strDate += "a"; strDate += "'Minutes = '"; strDate += "mm"; strDate += "'Seconds = '"; strDate += "ss";Now, create an object and format the date −SimpleDateFormat dateFormat = new SimpleDateFormat(strDate); String formattedDate = dateFormat.format(new Date());The following is an example −Example Live Demoimport java.text.SimpleDateFormat; import java.util.Date; public class Demo {    public static void main(String ... Read More

Signed Binary Integers

Chandu yadav
Updated on 27-Jun-2020 13:01:46

11K+ Views

Signed integers are numbers with a “+” or “-“ sign. If n bits are used to represent a signed binary integer number, then out of n bits, 1 bit will be used to represent a sign of the number and rest (n - 1)bits will be utilized to represent magnitude part of the number itself.A real-life example is the list of temperatures (correct to nearest digit) in various cities of the world. Obviously they are signed integers like +34, -15, -23, and +17. These numbers along with their sign have to be represented in a computer using only binary notation ... Read More

Format Date with DateFormat Short in Java

karthikeya Boyini
Updated on 27-Jun-2020 13:00:29

4K+ Views

DateFormat.SHORT is a constant for short style pattern.Firstly, we will create date objectDate dt = new Date(); DateFormat dateFormat;Let us format date for different locale with DateFormat.SHORT// FRENCH dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, Locale.FRENCH); // GERMANY dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, Locale.GERMANY);The following is an example −Example Live Demoimport java.text.DateFormat; import java.util.Date; import java.util.Locale; public class Demo {    public static void main(String args[]) {       Date dt = new Date();       DateFormat dateFormat; // Date Format SHORT constant       dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, Locale.FRENCH);       System.out.println("Locale FRENCH = " + dateFormat.format(dt));       dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, ... Read More

Advertisements