Articles on Trending Technologies

Technical articles with clear explanations and examples

Generate Random Float type number in Java

Ankith Reddy
Ankith Reddy
Updated on 29-Jun-2020 5K+ Views

In order to generate Random float type numbers in Java, we use the nextFloat() method of the java.util.Random class. This returns the next random float value between 0.0 (inclusive) and 1.0 (exclusive) from the random generator sequence.Declaration −The java.util.Random.nextFloat() method is declared as follows −public float nextFloat()Let us see a program to generate random float type numbers in Java.Example Live Demoimport java.util.Random; public class Example {    public static void main(String[] args) {       Random rd = new Random(); // creating Random object       System.out.println(rd.nextFloat()); // displaying a random float value between 0.0 and 1.0    } ...

Read More

Registers used in 8259

Chandu yadav
Chandu yadav
Updated on 29-Jun-2020 3K+ Views

The 8259 is a specialized I/O port chip. It is never used in the interfacing of I/O devices but is only used for controlling the interrupts in a microcomputer.8259 consists of A0 as the only address input pin. Hence for a microprocessor, only two addresses are possible for the 8259 ports. The two ports can be termed as low port and high port.The processor selects the low port when A0 = 0The processor selects the high port when A0 = 1The processor issues some words termed as command words to these ports so as to configure the 8259 better. There are ...

Read More

Implied addressing mode in 8085 Microprocessor

George John
George John
Updated on 29-Jun-2020 2K+ Views

In 8085 Instruction set, there is one mnemonic XCHG, which stands for eXCHanGe. This is an instruction to exchange contents of HL register pair with DE register pair. This instruction uses implied addressing mode. In the instruction, we don’t mention as “XCHG HL, DE”. It is implied that it will deal with HL and DEregister pairs. So we write only XCHG as mnemonic. That’s why it is called an implied addressing mode. As it is 1-Byte instruction, so It occupies only 1-Byte in the memory. After execution of this instruction, the content between H and D registers and L and ...

Read More

Overview of the working of 8259

Arjun Thakur
Arjun Thakur
Updated on 29-Jun-2020 2K+ Views

The interrupt requests are accepted by 8259 from many interrupting devices IR0 to IR7  pins. After that, it identifies the highest priority interrupt request from those inputs that are already active. To configure the 8259 for fixed priority mode of operation, among them IR0 has the highest and IR7 has the lowest priority. If the inputs IR2, IR4, and IR6 are active, thenIR2 has the highest priority interrupt request among the active requests than the other. The details of the interrupt requests those are active are stored in the Interrupt Request Register (IRR).By loading the Interrupt Mask Register (IMR), it ...

Read More

Architecture of 8259

Ankith Reddy
Ankith Reddy
Updated on 29-Jun-2020 5K+ Views

8259 Microprocessor is architected in a unique style. It can program by means of some interrupts conditions by means of level or interrupt level often called edge-triggered interrupt level. Masking is done to individual interrupt bits. As the number of 8259 increases interrupt pins up to 64 can be obtained. There are 3 registers 8259 contains along with one priority resolver(PR). They are as follows −Interrupt Request Register(IIR)  − It stores the bits who requests the interrupt.Interrupt service register(ISR) − It stores the currently interrupt levels.Interrupt Mask Register(IMR)  − Stores the interrupt levels to be masked.PriorityResolver(PR)  − Set the priority of ...

Read More

Pins of 8259

George John
George John
Updated on 29-Jun-2020 7K+ Views

Intel 8259 is designed as a 28-pin-programmable IC available as a package named DIP (Dual inline package). Its physical and functional pin diagrams are indicated below.PIN NameDescription and PurposesVcc and GndIt is the Power supply and ground pins. +5V power supply isused in this chip.D7-0For communication with the processor, there are Eight bi-directional data pins.RD*It is active low-input pin activated by the processor to read the information status from the 8259.WR*It is an active low-input pin which is activated by the processor to write the control information to  8259.CS*For selecting the chip it is used an active low input pin.A0An ...

Read More

Parse Octal string to create BigInteger in Java

Samual Sam
Samual Sam
Updated on 29-Jun-2020 215 Views

To parse the octal string to create BigInteger, use the following BigInteger constructor and set the radix as 8 for Octal −BigInteger(String val, int radix)This constructor is used to translate the String representation of a BigInteger in the specified radix into a BigInteger.In the below example, we have set the BigInteger and radix is set as 8.BigInteger one, two; one = new BigInteger("12"); two = new BigInteger("4373427", 8);The following is the complete example −Example Live Demoimport java.math.*; public class Demo {    public static void main(String[] args) {       BigInteger one, two;       one = new BigInteger("12"); ...

Read More

Parse decimal string to create BigInteger in Java

karthikeya Boyini
karthikeya Boyini
Updated on 29-Jun-2020 331 Views

To parse the decimal string to create BigInteger, just set the decimal string in the BigInteger.Here is our BigInteger.BigInteger one; String decStr = "687879"; one = new BigInteger(decStr);Let us see another example −Example Live Demoimport java.math.*; public class Demo {    public static void main(String[] args) {       BigInteger one, two;       String decStr = "4373427";       one = new BigInteger("250");       two = new BigInteger(decStr);       System.out.println("Result (BigInteger) : " +one);       System.out.println("Result (Parsing Decimal String) : " +two);    } }OutputResult (BigInteger) : 250 Result (Parsing Decimal String) : 4373427

Read More

Parse hexadecimal string to create BigInteger in Java

Samual Sam
Samual Sam
Updated on 29-Jun-2020 2K+ Views

To parse the hexadecimal string to create BigInteger, use the following BigInteger constructor and set the radix as 16 for Hexadecimal.BigInteger(String val, int radix)This constructor is used to translate the String representation of a BigInteger in the specified radix into a BigInteger.In the below example, we have set the BigInteger and radix is set as 16 −Example Live Demoimport java.math.*; public class Demo {    public static void main(String[] args) {       BigInteger one, two;       String hexStr = "290f98";       one = new BigInteger("250");       // parsing       two = ...

Read More

Parsing and Formatting a Big Integer into Binary in Java

Samual Sam
Samual Sam
Updated on 29-Jun-2020 2K+ Views

Firstly, take two BigInteger objects and set values.BigInteger one, two; one = new BigInteger("99"); two = new BigInteger("978");Now, parse BigInteger object “two” into Binary.two = new BigInteger("1111010010", 2); String str = two.toString(2);Above, we have used the following constructor. Here, radix is set as 2 for Binary for both BigInteger constructor and toString() method.BigInteger(String val, int radix)This constructor is used to translate the String representation of a BigInteger in the specified radix into a BigInteger.The following is an example −Example Live Demoimport java.math.*; public class Demo {    public static void main(String[] args) {       BigInteger one, two;     ...

Read More
Showing 42241–42250 of 61,248 articles
Advertisements