text:
## Altera Cyclone IV - ROM: 1-Port Problem

Started by 3 months ago22 replieslatest reply 3 months ago48 views

Hi,

I have created a MIF file containing 100 x 16bit values. The values point to a colour palette which contains the RGB values for 10 colours.

In Quartus Prime Lite I have used the IP Catalogue to create a ROM: 1-Port file

My top Verilog HDL file references the ROM file which when compiled / simulated on the FPGA development board should produce a 10 coloured stripped square (10 x 10 pixels) on the attached monitor. However, all I get is a blue square.

Could you please help me with where my code is going wrong. After I compile the design the total memory bits states 4 / 423,936 ( < 1 % ), which I believe is not right for the size of the data I am trying to place in the ROM memory.

I have attached the files for my design. Please ignore the 640x480 file name references, it should actually be 800x600

Pal.txt

Spriterom.v

VGA640x480.mif

[ - ]
Reply by April 14, 2019

Hi.

You have a declaration in your code:

reg clock;

The width of clock here is 1. But later you use it as a counter with range 0 to 100:

clock <= clock + 1;
if(clock == 100)
clock<=0;

Also it isn’t right to use clock as clock signal for your ROM. Clk should be used instead.

[ - ]
Reply by April 14, 2019

So if I change the "clock" to "clk" how would I be able to write values to "red", "green" and "blue" (the values I am trying to write to the internal ROM, which I can then obtain the RGB values from "Pal.txt" file).

I have searched the internet for simple examples of this, but I have not, as yet, found anything that helps / I can understand.

[ - ]
Reply by April 15, 2019

Every registers  and memory of your scheme should be clock by one signal, ‘clk’ in your case. Search for ‘synchronous design’.

To get a certain element  form ROM use ‘address’, not  ‘clock’

Spriterom u1(

clk,

q);

do ‘address  =  1’ and get  ‘q’ equal  05 in the next cycle of ‘clk’

do ‘address  =  address  +1 ’ and get  ‘q’ equal  01 in the next cycle of ‘clk’

and so on.

I got 05 and 01 from your mif file.

[ - ]
Reply by April 15, 2019

Hello,

I don't completely understand your plan...

If you use a ROM (Read-Only Memory), why do you want to write RGB values into ROM?

As stated by Duhast, it seems that there is a mistake with the 'clock' (as well as 'address'). For correct ROM behaviour, we need a clock (it seems to be 'clk' in your code), an address signal (address in your code in order to select one value out of the 100 in the .MIF file but not yet affected) and the resulted value (q in your code).

Moreover, one thing is strange for me: in line 54, pal_memory is on 16bits but in Pal.txt, values are on 8bits; and in the .MIF, you say values are on 16bits, but the highest value is '9' (so 4bits). I don't know if it is OK for you or if there is a confusion...

[ - ]
Reply by April 15, 2019

Many thanks for your replies.

I have amended the code to;

timescale 1ns / 1ps
module VGA640x480(clk, reset, red, green, blue, vsync,hsync);
input clk,reset;
output vsync,hsync;
output reg [4:0] red;
output reg [5:0] green;
output reg [4:0] blue;

reg [10:0] AH_SIZE=50;
reg axdir=1;
reg aydir=1;

//-------------------------------
// Load Spriterom from Internal
// Memory ROM: 1-Port
//-------------------------------

wire [15:0] q;

Spriterom u1(
clk,
q);

//-------------------------------
// VGA 800x600 Horizontal Values
//-------------------------------
parameter HTOTAL=1040;
parameter HZSYNC=120;
parameter HBACK_PORCH=64;
parameter HACTIVE=800;
parameter HFRONT_PORCH=56;
reg [10:0] H_SCAN;
reg HPOLARITY;

//-----------------------------
// VGA 800x600 Vertical Values
//-----------------------------
parameter VTOTAL=666;
parameter VTSYNC=6;
parameter VBACK_PORCH=23;
parameter VACTIVE=600;
parameter VFRONT_PORCH=37;
reg [10:0] V_SCAN;
reg VPOLARITY;

//-----------------------------
reg [15:0] pal_memory [0:29]; //16 bits wide: 3 (R G B) x 10 colours = 30
initial $readmemh("Pal.txt", pal_memory); //----------------------------- // Horizontal Timings //----------------------------- always@(posedge clk) begin //Horizontal Sync if(H_SCAN < HZSYNC) HPOLARITY <= 0; else HPOLARITY <= 1; //End of line if(H_SCAN == HTOTAL) H_SCAN <= 0; else H_SCAN <= H_SCAN + 1'b1; end assign hsync = HPOLARITY; //----------------------------- // Vertical Timings //----------------------------- always@(posedge clk) begin //Vertical Sync if(V_SCAN < VTSYNC) VPOLARITY <= 0; else VPOLARITY <= 1; //Bottom of screen if(H_SCAN == HZSYNC + HBACK_PORCH + HACTIVE) if(V_SCAN == VTOTAL) V_SCAN <= 0; else V_SCAN <= V_SCAN + 1; end assign vsync = VPOLARITY; always@(posedge clk) begin if((H_SCAN > HZSYNC+HBACK_PORCH) && (V_SCAN > VTSYNC+VBACK_PORCH) && (H_SCAN < HZSYNC+HBACK_PORCH+HACTIVE+1) && (V_SCAN < VTSYNC+VBACK_PORCH+VACTIVE+1)) begin if((H_SCAN > HZSYNC+HBACK_PORCH+100) && (V_SCAN > VTSYNC+VBACK_PORCH+50) && (H_SCAN < HZSYNC+HBACK_PORCH+110+1) && (V_SCAN < VTSYNC+VBACK_PORCH+60+1)) begin red <= pal_memory[q*3]>>3; green <= pal_memory[(q*3)+1]>>2; blue <= pal_memory[(q*3)+2]>>3; address <= address + 1; if(address == 100) address<=0; end else if((H_SCAN > HZSYNC+HBACK_PORCH+100) && (V_SCAN > VTSYNC+VBACK_PORCH+70) && (H_SCAN < HZSYNC+HBACK_PORCH+110+1) && (V_SCAN < VTSYNC+VBACK_PORCH+80+1)) begin red <= 0; green <= 255>>2; blue <= 0; end else begin red <= 0; green <= 0; blue <= 0; end end else begin red <= 0; green <= 0; blue <= 0; end end endmodule This draws a coloured square on the VGA monitor but the image is rolling to the right quite quickly (within the 10x10 pixel area). I have also added a green square below this as a comparison (both squares are the same size). The rolling square appears to only have 3 or 4 colours. I have initially set address = 0, as the first value is at address 0 (0 to 99). I'm not trying to write to the ROM, the red, green and blue are connected to the VGA on my development board (sorry, I didn't make this clear). For simplicity I have only included 8 bit values in Pal.txt. My intention is to use a larger palette, up to 255 colours. Your help again to try and get this right would be very much appreciated. [ - ] Reply by April 16, 2019 Are you sure about your video synchros??? I mean that H_SCAN counts from 0 to HTOTAL so 'HTOTAL+1' (1041) clock cycles. I suggest that you replace 'if(H_SCAN == HTOTAL)' by 'if(H_SCAN == HTOTAL-1)'; so that your signal counts from 0 to 1039 (1040 clock cycles). Same for V_SCAN. -> You should have a stable video now... If I understand clearly your code, a 10x10 area will be displayed starting at pixel (100; 50) to pixel (109; 59) with the contents of the .MIF and Pal.txt files. Do you want this behaviour? Identically, address counts from 0 to 100 (101 clock cycles). So each time a frame will be completed, you will have a shift of one pixel in your 10x10 square. [ - ] Reply by April 16, 2019 Thanks for the reply I have amended the code to; timescale 1ns / 1ps module VGA640x480(clk, reset, red, green, blue, vsync,hsync); input clk,reset; output vsync,hsync; output reg [4:0] red; output reg [5:0] green; output reg [4:0] blue; reg [10:0] AH_SIZE=50; reg axdir=1; reg aydir=1; //------------------------------- // Load Spriterom from Internal // Memory ROM: 1-Port //------------------------------- reg [6:0] address; wire [15:0] q; Spriterom u1( address, clk, q); initial address=0; //------------------------------- // VGA 800x600 Horizontal Values //------------------------------- parameter HTOTAL=1040; parameter HZSYNC=120; parameter HBACK_PORCH=64; parameter HACTIVE=800; parameter HFRONT_PORCH=56; reg [10:0] H_SCAN; reg HPOLARITY; //----------------------------- // VGA 800x600 Vertical Values //----------------------------- parameter VTOTAL=666; parameter VTSYNC=6; parameter VBACK_PORCH=23; parameter VACTIVE=600; parameter VFRONT_PORCH=37; reg [10:0] V_SCAN; reg VPOLARITY; //----------------------------- // Load palette reg [15:0] pal_memory [0:29]; //16 bits wide: 3 (R G B) x 10 colours = 30 initial$readmemh("Pal.txt", pal_memory);
//-----------------------------
// Horizontal Timings
//-----------------------------
always@(posedge clk)
begin
//Horizontal Sync
if(H_SCAN < HZSYNC)
HPOLARITY <= 0;
else
HPOLARITY <= 1;

//End of line
if(H_SCAN == HTOTAL-1)
H_SCAN <= 0;
else
H_SCAN <= H_SCAN + 1'b1;
end
assign hsync = HPOLARITY;
//-----------------------------
// Vertical Timings
//-----------------------------
always@(posedge clk)
begin
//Vertical Sync
if(V_SCAN < VTSYNC)
VPOLARITY <= 0;
else
VPOLARITY <= 1;
//Bottom of screen
if(H_SCAN == HZSYNC + HBACK_PORCH + HACTIVE-1)
if(V_SCAN == VTOTAL-1)
V_SCAN <= 0;
else
V_SCAN <= V_SCAN + 1;
end
assign vsync = VPOLARITY;

always@(posedge clk)
begin
if((H_SCAN > HZSYNC+HBACK_PORCH-1) && (V_SCAN > VTSYNC+VBACK_PORCH-1) && (H_SCAN < HZSYNC+HBACK_PORCH+HACTIVE) && (V_SCAN < VTSYNC+VBACK_PORCH+VACTIVE))
begin
if((H_SCAN > HZSYNC+HBACK_PORCH-1+100) && (V_SCAN > VTSYNC+VBACK_PORCH-1+50) && (H_SCAN < HZSYNC+HBACK_PORCH+110) && (V_SCAN < VTSYNC+VBACK_PORCH+60))
begin
red <= pal_memory[q*3]>>3;
green <= pal_memory[(q*3)+1]>>2;
blue <= pal_memory[(q*3)+2]>>3;
end

else
begin
red <= 0;
green <= 0;
blue <= 0;
end
end
else
begin
red <= 0;
green <= 0;
blue <= 0;
end
end
endmodule

I have made the changes you suggested. I have also noticed that;

if((H_SCAN > HZSYNC+HBACK_PORCH) && (V_SCAN > VTSYNC+VBACK_PORCH) && (H_SCAN < HZSYNC+HBACK_PORCH+HACTIVE+1) && (V_SCAN < VTSYNC+VBACK_PORCH+VACTIVE+1))  begin   if((H_SCAN > HZSYNC+HBACK_PORCH+100) && (V_SCAN > VTSYNC+VBACK_PORCH+50) && (H_SCAN < HZSYNC+HBACK_PORCH+110+1) && (V_SCAN < VTSYNC+VBACK_PORCH+60+1))

appeared to be wrong. Perhaps you could please advise (or otherwise) if you agree to these changes.

I have changed: if(address == 100) to 99.

The image displays steady on the monitor but I am missing the 10th pixel on each horizontal line (i.e. 9 wide x 10 high).

If I understand clearly your code, a 10x10 area will be displayed starting at pixel (100; 50) to pixel (109; 59) with the contents of the .MIF and Pal.txt files. Do you want this behaviour?

The .mif file contains different values (eg. 01) and the "Pal.txt" file contains 30 values (consecutive values for Red Green Blue x 10). This is how the colour of each pixel is displayed. I shift right Red and Blue by 3 bits and Green by 2 bits, to match the RGB available bits on the development board. Is there a better way to do this or have I misunderstood your question?

[ - ]
Reply by April 17, 2019

My question was to be sure my understanding... You would like to display on the monitor a 800x600 black and steady image; like this:

____________

|          |

|  XX      |

|  XX      |

|          |

____________

where XX represents a 10x10 area (so the 100 values into .MIF; one value into the .MIF represents a colour which is RGB'ed thanks to Pal.txt file). The 10x10 area is positionned at pixel (100; 50) to pixel (109; 59).

Why do you think your code is wrong?

if ((H_SCAN > HZSYNC+HBACK_PORCH) && (V_SCAN > VTSYNC+VBACK_PORCH) && (H_SCAN < HZSYNC+HBACK_PORCH+HACTIVE+1) && (V_SCAN < VTSYNC+VBACK_PORCH+VACTIVE+1))
begin
if((H_SCAN > HZSYNC+HBACK_PORCH-1+100) && (V_SCAN > VTSYNC+VBACK_PORCH-1+50) && (H_SCAN < HZSYNC+HBACK_PORCH+110) && (V_SCAN < VTSYNC+VBACK_PORCH+60))

By replacing with the value, it comes:

if ((H_SCAN > 184) && (V_SCAN > 29) && (H_SCAN < 985) && (V_SCAN < 630))
begin
if((H_SCAN > 283) && (V_SCAN > 78) && (H_SCAN < 294) && (V_SCAN < 89))

So the second 'if' will entered if H_SCAN and V_SCAN will respectively be in the range [284; 293] (10 values) and [79; 88] (10 values).

So, for me, it's correct...

Why do you miss the 10th pixel?

Good question! Difficult to say without deeper knowledge of the whole system...

As you are in RGB, you do not have to worry about chroma subsampling...

Can you test with a 8x8 area (or 8x10) and a 9x9 area (or 9x10)?

Is it better? Or do you still have the last column missing?

[ - ]
Reply by April 18, 2019

With the values that you have entered, I can see that the code is correct, thanks for that.

I have created the different combinations which you have suggested and each time the right most pixel on each line is missing.

Example: for 9x9 (a square with a border around using palette codes 01 and 02;

01 01 01 01 01 01 01 01 01

01 02 02 02 02 02 02 02 01

01 02 02 02 02 02 02 02 01

01 02 02 02 02 02 02 02 01

01 02 02 02 02 02 02 02 01

01 02 02 02 02 02 02 02 01

01 02 02 02 02 02 02 02 01

01 02 02 02 02 02 02 02 01

01 01 01 01 01 01 01 01 01

I'm not entirely sure if I have created the ROM file correctly using the Megawizard in Quartus Prime Lite. I have attached a screen shot of the 5 stages to create it.

Page 4 mentions it requires file/s: altera_mf, however I have the file alter_mf.v in the correct folder in my version of Quartus Prime, and the Megafunction does generate the ROM file.

[ - ]
Reply by April 19, 2019

ROM generation seems to be OK.

One way to resolve the problem is to get rid of (temporarily) the ROM and affect constant values to red/green/blue.

red <= 255; //instead of red <= pal_memory[q*3]>>3;)
green <= 255; //instead of green <= pal_memory[(q*3)+1]>>2;
blue <= 255; //instead of blue <= pal_memory[(q*3)+2]>>3;

Then, as I said, you may try with different square areas. Using constants may be easier:

if((H_SCAN > HZSYNC+HBACK_PORCH) && (V_SCAN > VTSYNC+VBACK_PORCH) && (H_SCAN < HZSYNC+HBACK_PORCH+HACTIVE+1) && (V_SCAN < VTSYNC+VBACK_PORCH+VACTIVE+1))
begin
if((H_SCAN > HZSYNC+HBACK_PORCH+ORIGIN_X) && (V_SCAN > VTSYNC+VBACK_PORCH+ORIGIN_Y) && (H_SCAN < HZSYNC+HBACK_PORCH+ORIGIN_X+SIZE_X+1) && (V_SCAN < VTSYNC+VBACK_PORCH+ORIGIN_Y+SIZE_Y+1))

where (ORIGIN_X; ORIGIN_Y) is the origin (top left corner: (100; 50) in your original code) and (Size_X; Size_Y) is the size of the square ((10;10) in your original code).

You may try especially 1x1 area (or 1x10 area). Is it OK?

Maybe, chroma subsampling is the problem (but I don't think..). Try with an odd ORIGIN_X (ORIGIN_X=101 for example). Is it OK?

[ - ]
Reply by April 19, 2019

1. I tried an image 2x10 and lost the 2nd (last) pixel, as in previous attempts (this was still using the read from ROM values): ROM contained "01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02 01 02" and I changed my colour palette to "ROM Data 01 = FF FF 00 = Yellow" and "02 = 00 00 FF = Blue"

2. I tried an image 1x10 and nothing appeared on the screen.

3. Then, as you suggested I used RGB values (255,255,0) for an image 1x10 and I could see the yellow 10 pixel vertical line, however, this was half the thickness (width) compared to number 1 above. It looks like item 1 above is showing 2 pixels wide but in yellow, not yellow + blue as I would have expected.

[ - ]
Reply by April 19, 2019

Just a thought, I have something in my mind that I think I read somewhere that the clock speed for reading ROM/RAM should be twice the speed of the normal clock speed (i.e 100Mhz clk for ROM read and 50Mhz clk speed for everything else). But I may be getting confused with something else.

[ - ]
Reply by April 23, 2019

I have since done the following;

1. Installed the latest update for Intel Quartus Prime Lite 18.1.1

2. Created new a MIF file 9x9 pixels using 8 bit values

+0 +1 +2 +3 +4 +5 +6 +7 +8

00: 01 01 01 01 01 01 01 01 01
09: 01 02 02 02 02 02 02 02 01
18: 01 02 02 02 02 02 02 02 01
27: 01 02 02 02 02 02 02 02 01
36: 01 02 02 02 02 02 02 02 01
45: 01 02 02 02 02 02 02 02 01
54: 01 02 02 02 02 02 02 02 01
63: 01 02 02 02 02 02 02 02 01
72: 01 01 01 01 01 01 01 01 01

3. Created a new Spriterom file using Quartus Prime Megawizard with 8 bit values

4. Pal.txt only contains four colours

00: FF 00 00 = Red
01: FF FF 00 = Yellow
02: 00 00 FF = Blue
03: FF FF FF = White

5. Checked the 800x600 @ 72hz timings

Arranged the Horizontal and Vertical in this order;

HACTIVE + HFRONT_PORCH + HZSYNC + HBACK_PORCH
800   +       56     +  120   +     64

VACTIVE + VFRONT_PORCH + VTSYNC + VBACK_PORCH
600   +       37     +    6   +     23

Changed line 100 in my top module to:
if(H_SCAN == HTOTAL-1) // was: HZSYNC + HBACK_PORCH + HACTIVE-1)

When the 9x9 image is not being drawn, i have set all other pixels in the active 800x600 range to red.

FINDINGS;

The last horizontal pixel in the 9x9 image is actualy being displayed as black pixels. This was the reason why i could not see it with all other pixels (besides the 9x9 image) being black also.

So, the last pixel in each horizontal line of the image is always showing in black.

If anyone has any suggestions, that would be very nuch appreciated.

I have tried (but with little success) created a test bench with ModelSim-Altera and ran the RTL simulation through NativeLink. If anyone could help with this, it would also be very much appreciated.

To help, I have attached 5 files in respect of the above;

Pal.txt

Spriterom.v

VGA640x480.mif

VGA640x480.v

[ - ]
Reply by April 24, 2019

You don't need to have a two times faster clock. In your case, you would like to generate one pixel at each clock cycle, and so we need to read one value out of ROM each clock cycle.

You may need to have a faster clock if you store into the ROM the 3 values of the pixel. In this case, you will need to read one red then one green and finally one blue at a clock 3 times faster than glue logic.

I don't catch what your problem is now...

I suggest that you use a SignalTap to see what happens in your design. The code seems to be OK but a view of the real behaviour on board will be usefull...

[ - ]
Reply by April 24, 2019

Many thanks for the reply and for explaining about when to use faster clock speeds, it makes sense now.

I have shown below what the screen looks like (not an actual screen shot though).

It should be a red background (which it is) and the 9x9 image should have a yellow border with inner pixels blue. However, the last pixel on each horizontal line of the 9x9 image is always black, regardless of the value I use in the MIF / ROM file. The Pal.txt file does not have a colour palette for black set.

Hope this makes sense and you understand the problem.

I have tried the Signal Tap Logic Analyser. I set the signal configuration: clock to "clk" and tried different combinations of nodes "q" , "address" , "H_SCAN" and "V_SCAN", but I cant' seem to see any changes in "q". I have also tried different levels of sample depth. I have selected "Start Compilation", "Program Device" and "Run Analysis"

I also tried using the "clock" from the Spriterom module as the signal configuration: clock.

Guess what I am trying to obtain is the 81 values of "q" for the 9x9 image. Could you please give me some pointers on how to set this up?

Your assistance is very much appreciated.

[ - ]
Reply by April 25, 2019

The last column in black is interesting as it seems to be not authorized in your code (not red, not yellow neither blue). Thus it seems that your code is correct... Let's check using SignalTap!

Config:

Keep clk for clock. Put 1k for sample depth.

Setup tab:

Select the signals you wish to see and/or trigger (H_SCAN, V_SCAN, address, q, red, green, blue)

Set the trigger: H_SCAN = HZSYNC+HBACK_PORCH+ORIGIN_X+1 = 284 (you need to check!) and V_SCAN = VTSYNC+VBACK_PORCH+ORIGIN_Y+1 = 79 (check!)

-> Compile, program, run analysis

SignalTap will display 1024 clock cycles (the 1k you put in sample depth) from the trigger...

ie when H_SCAN will be 284 and V_SCAN will be 79, it will display H_SCAN, V_SCAN, address, q, red, green, blue.

You can check if it is correct as expected... (for 284 and 79, you are (normally) in the top left corner of your NxN area, so you should have address=0 and a q corresponding to the first elemet in your .MIF, so a red/green/blue at yellow).

Check with different valeus of triggers (different values of H_SCAN and V_SCAN) to see if all RGB are correct... (you don't need to re-compile when changing trigger values. Recompiling is just needed if we add new signal or config).

[ - ]
Reply by April 25, 2019

Thanks for getting back again.

I have re-arranged my horizontal and vertical layout as shown in this file VGA640x480.v

The 9x9 image should be displayed at 100,50 (64h,32h)

I have hopefully run SignalTap as you described as follows;

Setup: Pic 1.jpg

At 100,50 (64h,32h): Pic 2.jpg

At 100,51 (64h,33h): Pic 3.jpg

If I am reading the data correctly things do not seem to line up;

at 100,50: address=0, RGB=Red (Not Correct)

at 108,50: address=8, RGB=Yellow (Correct)

at 100,51: address=9, RGB=Red (Not Correct)

at 108,51: address=17 (11h), RGB=Blue (Nor Correct)

[ - ]
Reply by April 26, 2019

First of all, there is one clock cycle between the 'input' and the 'output' of your process. So at (100; 50), you compute the pixel which will be available at the next clock cycle. So, here you have RGB=(1F; 3F; 0) for that pixel (100; 50).

For the 50th row, you have 9 pixels at yellow.

For the 51th row, you have 2 pixels at yellow, followed by 7 pixels at blue.

I have commented one of your image: pic 2_22402.jpg

One problem of your code is that the 'q' value will be late by one clock. So, I think that you need to anticipate and start counting at -1 (initial address=-1).

I suggest that you modify your ROM with different values (@0=1, @1=2, ...). In that way, you will see the corresponding value of q according to the address (which will be one clock earlier). For pixel (100;50), you need to have the corresponding q and an address at 1 (because you should anticipate the value q needed for pixel (101;50) ).

Hope this is clear!

I also suggest that you put Red, Green and Blue signals in 'Trigger Enable'. In that way, by triggering Red=Green=Blue=0, you could see for which pixel you have black value. According to your code, it should appear in the synchro portion. But as you stated earlier, you have black in video portion (maybe you should change the value in the synchro to not have black).

[ - ]
Reply by April 27, 2019

I have set address=-1, changed the ROM file to values 01 02 03 04 05 06 07 08 09 and changed my Pal.txt to include the 01 to 09 RGB colours (FF 00 00 FF FF 00 00 00 FF FF FF 00 00 00 FF FF FF 00 00 00 FF FF FF 00 00 00 FF FF FF 00 00 00 FF FF FF FF)

Prior to my "IF" is true for 100,50 "q" contains 01h even though the value of "address=-1". Is this because a negative value in "address" will result in fetching from ROM the 1st value, in this case 01h.

H_SCAN and V_SCAN are being checked and incremented accordingly on each positve "clk" pulse, and it is not until the following positive "clk" pulse when any new values of H_SCAN and V_SCAN are available in my "Display Image on VGA Monitor" design

Whem my "IF" is true for 100,50 (one clock pulse on from when H_SCAN and V_SCAN equalled these values) "q" still contains 01h, R G B = 1F,3F,00, address starts at "-1" and is incremented to "0".

The next clk pulse, as "address=0", "q" will again have a value of 01h

I understand why you suggest to initially set address=-1 as this aligns the values in SignalTap. However, this has an effect on "q". "q" has the same value for H_SCAN=100 and 101, as shown in this data from SignalTap; address -1.png

I have tried to align "q" by including;

here;

if((H_SCAN >99) && (V_SCAN > 49) && (H_SCAN < 109) && (V_SCAN < 59))
begin
red <= pal_memory[q*3]>>3;
green <= pal_memory[(q*3)+1]>>2;
blue <= pal_memory[(q*3)+2]>>3;
else if(address == 80)
end

but this has no effect on the values in "q".

I tried triggering Red, Green and Blue = 0 and did not see them in the 9x9 image area (that's if I did it right).

Also changed the Red, Green and Blue values = 1 for the syncro, this didn't appear to change anything.

[ - ]
Reply by April 29, 2019

I confess that I don't understand everything...

Secondly, as Verilog is not my prefer language (I am more a VHDL expert!), maybe the "address=-1" is not correct in verilog.

One way to resolve your address mismatch is to anticipare with a second 'IF'.

if((H_SCAN==98) && (V_SCAN==50))
begin
// Initialisation at pixel (98; 50)
//   -> address should be 0 when (99; 50)
//   -> so when (100; 50) data (present at @0) will be available for the
// computation of the pixel
end
if((H_SCAN>98) && (V_SCAN > 49) && (H_SCAN < 108) && (V_SCAN < 59))
begin
// count for pixel (99; 50) ... (107; 50)
// ...
// count for pixel (99; 58) ... (107; 58)
// when (106; 58), address whould be 80 decimal
// when (107; 58), address whould be 81 decimal
end
if((H_SCAN >99) && (V_SCAN > 49) & && (H_SCAN < 109) && (V_SCAN < 59))
begin
red <= pal_memory[q*3]>>3;
green <= pal_memory[(q*3)+1]>>2;
blue <= pal_memory[(q*3)+2]>>3;
end

You should have something like this:

H_SCAN  98 99 100 101 102 103 104 105 106 107 108 109 ...
V_SCAN  50 50 50  50  50  50  50  50  50  50  50  50  50
address X  0  1   2   3   4   5   6   7   8   9   9   9    -> X should be 81 (rollover)
q[7:0]  X  X  1   2   3   4   5   6   7   8   9  10  10    -> X should be 82(rollover)
<-------------------------------->
9 required values from (100;50) to (108; 50)

H_SCAN  98 99 100 101 102 103 104 105 106 107 108 109 ...
V_SCAN  51 51 51  51  51  51  51  51  51  51  51  51  51
address 9  9  10  11  12  13  14  15  16  17  18  18  18
q[7:0]  10 10 10  11  12  13  14  15  16  17  18  19  19
<-------------------------------->
9 required values from (100;51) to (108; 51)

...

H_SCAN  98 99 100 101 102 103 104 105 106 107 108 109 ...
V_SCAN  58 58 58  58  58  58  58  58  58  58  58  58  58
address 72 72 73  74  75  76  77  78  79  80  81  81  81
q[7:0]  73 73 73  74  75  76  77  78  79  80  81  82  82
<-------------------------------->
9 required values from (100;58) to (108; 58)

>>I tried triggering Red, Green and Blue = 0 and did not see them in the 9x9 image area (that's if I did it right).

So, you didn't see black column in the 9x9 area while there is this column in the display.

>>Also changed the Red, Green and Blue values = 1 for the syncro, this didn't appear to change anything.

This was just to be sure that when you set your trigger to RGB=0, we didn't capture during synchro.

I suggest that you continue so as to be sure the 9x9 area is correct (thanks to SignalTap). When this will be correct, you can investigate further...

What is your connection after FPGA: Are RGB signals connected directly to monitor or is there is video encoder?

[ - ]
Reply by April 30, 2019

Your code seems to be working very well: Alligned.png

I tried the original 9x9 yellow border filled with blue and it worked very well. I have tried a larger image (clipart off Google) with more colours and this also works very well;

Although the camera on my phone used to take the screen shot is not the best. The left image (a bumble bee) is about 80x50 pixels

I am using a FPGA development board with a VGA connector as part of the board. It has 16 bit colour (5 Red, 6 Green and 5 Blue bits). The board is then connected directly to a monitor / tv screen with VGA.

If I could take this opportunity to thank you for all the help and patience which you have kindly provided. I have also learnt a lot from you, including how to use SignalTap, thank you adouville.

[ - ]
Reply by May 2, 2019

You're welcome... If I can help, it is with great pleaure!


text:
# Z/nZ

#### SherlockWante

##### New member
As the notation of Multiplicative group of integers modulo n I see: (Z/nZ)^x
What is this notation actually?

#### HallsofIvy

##### Elite Member
Z is the set of integers. nZ is the set of integer multiples of n. Z/nZ is the set of integers "modulo n". The "$$\displaystyle \times$$" superscript indicates the group operation is multiplication.

Last edited:

format: plain


text:
MAKESET

Writes Set header information to images

Description:

This routine is used to group images into a Set so that they can be processed together. It is usually used when you have CCD data from a single exposure in multiple files because they were generated from multiple CCDs in a mosaic camera, or from multiple amplifiers in the same CCD, or both. When this program is run on a group of files, header information is written to each one so that other CCDPACK routines will know about the relationship between them.

MAKESET writes the following items of data to the .MORE.CCDPACK.SET extension of each image:

• The Set NAME (a string identifying all images in the same Set)
• The Set INDEX (an integer identifying the image’s position within the Set)

and it will also optionally (if ADDWCS is set true) write:

• The Set coordinate system (a coordinate frame in the NDF’s WCS component with the Domain ’CCD_SET’).

Normally by just presenting a list of image names to the program the values of these attributes will be taken care of automatically, but various options exist to tune how it is done.

makeset in mode

Parameters:

If ADDWCS is true, then MAKESET will attach a new coordinate system to the WCS component of the image. The new coordinate frame will be a copy of the Current coordinate frame of the image, and will have the Domain name of ’CCD_SET’; CCDPACK tasks concerned with registration know about this name and will use those coordinates on the assumption that they constitute a correct registration of images if they are present. Therefore this parameter should be set true if the images which will form a Set are known to be aligned in their common Current coordinate system.

If MODE=SPLIT, this parameter is ignored and a new CCD_SET coordinate system which is a copy of the Pixel coordinate system will be added in any case. [TRUE]

If this parameter is supplied, it gives the name of a file containing Set coordinate information. A new coordinate frame will accordingly be written into the WCS component of each image, with the Domain name ’CCD_SET’; CCDPACK tasks concerned with registration know about this name and will use those coordinates on the assumption that they constitute a correct registration of images if they are present. The newly added coordinate system will become the Current coordinate system of the image.

The file named by this parameter will normally have been written by the ASTEXP program, saving a known correct alignment of images within a Set that corresponds to the one being created by this program. This parameter is ignored if MODE=SPLIT. [!]

The name of the FITS header card whose value will determine the Set Index attribute of each file. The Set Index header value itself is determined from the value of the chosen FITS header card and the value of the INDEXVALS parameter. Only used if MODE=FITS.
The name of the FITS header card whose value will determine the Set Name attribute of each file. The Set Name header value is taken directly from the chosen FITS header card. Only used if MODE=FITS.
A group expression giving a list of images to group into one or more Sets. The order in which they are listed will normally determine their INDEX values (but see the INDICES parameter), so that the Sets should be generated by presenting images in a consistent order; the one from CCD1 first, the one from CCD2 second...
INDEXVALS( $\ast$ ) = LITERAL (Read)
A list of strings to map the value of the FITS header card indicated by the FITSINDEX parameter to the Set Index value; if the header value matches the $N$th element of this list the file will be given a Set Index value of $N$. This parameter will dynamically default to a sorted list of all the values of the chosen parameter which exist in all the input files presented. This will usually be a suitable value if at least one complete Set is being considered. Note that each value must in general be surrounded by double quotes. Only used if MODE=FITS.
INDICES( $\ast$ ) = _INTEGER (Read)
This parameter is a list of positive integers with SETSIZE elements (SETSIZE will normally be the same as the number of images accessed by the IN parameter). It indicates, for each image in the list, what value the Set INDEX attribute should take. If set to the null value (!) then INDEX attributes will be assigned in order (1, 2, 3, ...) for the members of each Set. Only used if MODE=LIST. [!]
Name of the CCDPACK logfile. If a null (!) value is given for this parameter then no logfile will be written, regardless of the value of the LOGTO parameter.

If the logging system has been initialised using CCDSETUP then the value specified there will be used. Otherwise, the default is "CCDPACK.LOG". [CCDPACK.LOG]

Every CCDPACK application has the ability to log its output for future reference as well as for display on the terminal. This parameter controls this process, and may be set to any unique abbreviation of the following:
• TERMINAL – Send output to the terminal only

• LOGFILE – Send output to the logfile only (see the LOGFILE parameter)

• BOTH – Send output to both the terminal and the logfile

• NEITHER – Produce no output at all

If the logging system has been initialised using CCDSETUP then the value specified there will be used. Otherwise, the default is "BOTH". [BOTH]

Determines exactly how Set header information should be written to the IN files. It may take one of the following values:
• LIST

• CONTAINER

• FITS

• SPLIT

When MODE=LIST, new Sets will be formed according to the order in which images are named in the IN list. In the most straightforward case, all the named files will become part of the same new Set, with a Set Name derived from the name of the first file in the list and consecutive Set Index values 1, 2, 3, …The SETSIZE and INDICES parameters can be used to create multiple sets in one invocation and to modify the ordering.

When MODE=CONTAINER, one new Set will be formed for each HDS container file; thus each image will be grouped with the other images in the same container file, being given a Set Name based on the name of the container file and a Set Index based on its position within it. HDS container files suitable for feeding to MAKESET with MODE=CONTAINER are often the result of converting multi-extension FITS files to NDF format.

When MODE=FITS the Set attributes of each image are determined by the value of FITS header cards with keywords given by the FITSINDEX and FITSNAME parameters. The Set Name attribute is given directly by the value of the FITSNAME- chosen header. The Set Index attribute is given by the position of the value of the FITSINDEX-chosen header in the list determined by the INDEXVALS parameter. Note this can only be used if both a Name-like and an Index-like header card is available in the FITS header of each file.

When MODE=SPLIT, a new Set is created for each of the members of the IN list. Each Set will consist of the data from the input image split up into pieces according to the XSTART and YSTART parameters, or the SECTIONS parameter. A new HDS container file will be written for each IN file, with a name given by the OUT parameter. Each split piece of the input file will be written as a separate NDF structure in the container file, with a Set Name given by the name of the original image and a Set Index given by the position in the list of pieces. Unlike the other modes, this does not alter the input file, but creates a new output file to contain the rearranged data. [LIST]

The NAME parameter is used to determine the Set NAME attribute which the grouped images will have; all images in the same Set have the same NAME. The value of this parameter should be a group expression containing the same number of elements as the number of Sets being created; if it contains modification elements such as "$\ast$" they are applied to the name of the first image in each Set.

The default value is "$\ast$", which means the Set NAME is the same as the name of the image first entered into each Set (if MODE=LIST) or the name of the HDS container file (if MODE=CONTAINER). If MODE=FITS it is ignored. There is normally no need to use a value other than the default. [$\ast$]

If MODE=SPLIT, this parameter gives the names to use for the output HDS container files; one output filename must be specified for each input image. These may be given as a comma-separated list of names, using indirection if required, or as a single modification element (of the input names). A common modification element is ’$\ast$’, meaning the same name as the input file, so out="$\ast$-set" would create output files with the same name as the input files but with "-set" appended.

If MODE is not SPLIT then no new output files are created, so this parameter is ignored.

SECTIONS( $\ast$ ) = LITERAL (Read)
If MODE=SPLIT, this parameter may be used to give a list of NDF section specifiers from which to form the members of the newly created Set. Each element may optionally be enclosed in parentheses, and should be of the form explained in the "NDF Sections" section of SUN/33; typically it will be of the form "(xmin:xmax,ymin:ymax)". Note that if supplying this parameter on the command line it will be necessary to include each element in quotes and the whole list in square brackets, e.g.: sections=["(17:500,1:1024)","(525:1000,1:1024)"]

When using a Unix shell the whole thing will have to be placed in single quotes as well.

If a null value (!) is given for this parameter the XSTART and YSTART parameters are used instead; if the sections into which the input images are to be split tile the whole of the input image, this is usually more convenient. This parameter is ignored unless MODE=SPLIT. [!]

The number of images in each Set. This will default initially to the number of images in the IN list, but if set to a number less than that, then more than one set will be generated (the first SETSIZE from IN will become the first set, and so on). If INDICES is specified it must have SETSIZE elements, and Set INDEX assignment will wrap round when SETSIZE elements have been processed. SETSIZE must be positive, and must be a divisor of the number of images in the IN list, so that each distinct Set created by one invocation of MAKESET is forced to be the same size. Only used if MODE=LIST. [dynamic]
XSTART( $\ast$ ) = _INTEGER (Read)
If MODE=SPLIT and SECTIONS is null, this gives a list of the first pixel index in the X direction (first coordinate) of rectangular regions which will become members of a new Set. If there are NX elements given for XSTART and NY for YSTART then each created Set will contain NX$\ast$NY members. The region at position (IX,IY) will be composed of pixels XSTART(IX)..XSTART(IX$+$1)-1 in the X direction and YSTART(IY)..YSTART(IY$+$1)-1 in the Y direction, where the last pixel in the input image is implied for the upper bound of the NX’th element of XSTART. The XSTART and YSTART parameters are given for convenience; the same information can be given by specifying an appropriate value for the more flexible SECTIONS parameter.
YSTART( $\ast$ ) = _INTEGER (Read)
If MODE=SPLIT and SECTIONS is null, this gives a list of the first pixel index in the Y direction (second coordinate) of rectangular sections which will become members of a new Set. If there are NX elements given for XSTART and NY for YSTART then each created Set will contain NX$\ast$NY members. The region at position (IX,IY) will be composed of pixels XSTART(IX)..XSTART(IX$+$1)-1 in the X direction and YSTART(IY)..YSTART(IY$+$1)-1 in the Y direction, where the last pixel in the input image is implied for the upper bound of the NY’th element of YSTART. The XSTART and YSTART parameters are given for convenience; the same information can be given by specifying an appropriate value for the more flexible SECTIONS parameter.

Examples:

makeset "data1,data2,data3,data4" addwcs mode=list
This will write Set information into the named images; they will all be given the same Set Name attribute ("data1") and will be given the Set Index attributes 1, 2, 3 and 4 respectively. Additionally, a new attached coordinate system with the Domain "CCD_SET" will be added to the World Coordinate System (WCS) component of each; this will be a copy of each one’s Current attached coordinate system. If not all of them have the same Current coordinate system when the program is run (i.e. they do not all have the same Domain), then a warning will be issued.
makeset $\ast$ mode=container
In this case, all the images in the current directory are assigned Set header information based on how they are contained within HDS container files.
makeset $\ast$ mode=list setsize=4
This will add Set information to all the images in the current directory, grouping them into Sets of 4 images each. If MAKESET is to be used in this way however it must be done with care, since it will group the files in the order in which they are presented. This depends on what order the "$\ast$" character is expanded in, which depends on the details of the shell that you are using. Typically shells expand alphabetically, so that if the directory contains files with the names d08.sdf, d09.sdf, d10.sdf, d11.sdf they will be presented in that order, but files with the names d8.sdf, d9.sdf, d10.sdf, d11.sdf would be presented in the order d10.sdf, d11.sdf, d8.sdf, d9.sdf. Unless you are confident of how your shell behaves in this respect, then when using wildcards you should pay careful attention to the log output of MAKESET to check that the order is correct. It is safest to list Set members explicitly as in the previous example.
makeset "d1,d2,d3,e1,e2,e3" name=night1-$\ast$ setsize=3 addwcs=no
This will construct two Sets, which will be given Set Name attributes of "night1-d1" and "night1-e1" respectively. You might want to do this if you are going to use these files along with other Sets generated from files with the names the same as these. No additions are made to the WCS componnent of the images.
makeset "d1,d3" indices=[1,3]
This will construct a Set of the two named images, giving them the Set Index attributes of 1 and 3 respectively. This might be necessary for comparison with 3-member sets if the Index=2 one is absent in this case due to a loss of the data file for some reason.
makeset multi split out=multi-s
sections=["(1:32,1:48)","(1:32,49:96)", "(33:64,1:48)","(33:64,49:96)"] A new HDS container file called multi-s is created which contains the data from the single image multi, split up into four new images. A new coordinate system with the domain CCD_SET will be added which is a copy of the Pixel coordinates, and the Pixel coordinate of each of the new images will be the same as it was in the original.
makeset multi split out=multi-s
sections=["(:32,:48)","(:32,49:)","(33:,:48)","(33:,49:)"] If the input image ‘multi’ has X pixels in the range 1:64 and Y pixels in the range 1:96, this does exactly the same as the previous example, cutting multi into quarters. The abbreviated NDF section specifier syntax allows omission of a pixel bound when it is at the edge of the image.
makeset in=$\ast$ mode=split out=$\ast$-s sections=!
xstart="1,33" ystart="1,49" This does the same as the previous example again, using the somewhat simpler XSTART and YSTART parameters. This time a new Set is created for each of the images in the current directory, and written into a container file with the same name but ’-s’ appended.

Notes:

• When MODE=CONTAINER, membership of a Set is not strictly determined by the identity of the HDS container file in which it resides, but by the pathname supplied to the IN parameter which identifies that HDS container file. Thus it is possible to create members of two Sets within a single container file in one invocation of MAKESET, but it’s most unlikely that this will result unless you are deliberately invoking it in a bizarre way.

• When a non-null ASTFILE parameter is supplied, this program duplicates much of the functionality of ASTIMP.

Behaviour of Parameters

All parameters retain their current value as default. The "current" value is the value assigned on the last run of the application. If the application has not been run then the "intrinsic" defaults, as shown in the parameter help, apply.

Retaining parameter values has the advantage of allowing you to define the default behaviour of the application. The intrinsic default behaviour of the application may be restored by using the RESET keyword on the command line.

Certain parameters (LOGTO and LOGFILE) have global values. These global values will always take precedence, except when an assignment is made on the command line. Global values may be set and reset using the CCDSETUP and CCDCLEAR commands.


text:
# Terminology: changing the codomain in nested maps (e.g. in multilinear algebra)

The context of this question is given below but I don't think it is of essence here, so I will try to formulate the question for maps between sets.

Given two sets $A$ and $B$, denote the set of all maps $f\colon A\to B$ by $B^A$. Then, given a set $C$, a map $h\colon B\to C$ "lifts" to a map $h^A\colon B^A\to C^A$ defined by $h^A(f)(a)=h(f(a))$ for all $f\in B^A$ and $a\in A$.

This construct allows to "change the final codomain" in a "nested" map $F\colon X\to Z^Y$ with a simple composition operation: given a map $H\colon Z\to W$, the composition $H^Y\circ F$ is well defined and creates a map $X\to W^Y$ where the "final codomain" $Z$ has been changed to $W$. The point here is that $H^Y\circ F$ still only takes a single argument from $X$ and after evaluation then a single argument from $Y$.

In case you are curious, I want to use something like this to calculate with Hessian operators for vector-valued maps on Riemannian manifolds and their duals without using explicit basis notation. The above construct allows to do that quite conveniently, including certain types of "chain rules".

The questions are: does this construct have a name? Maybe something from category theory? Is this idea of "lifting" $h$ to $h^A$ standard? Does it have a name?

-
Probably you intended to write $h^A(f)(a)=h(f(a))$ in the second paragraph. –  Joel David Hamkins Jun 12 '12 at 12:46
This is exactly the statement that $-^A$ is a functor: en.wikipedia.org/wiki/Functor ; ncatlab.org/nlab/show/functor –  Finn Lawler Jun 12 '12 at 14:52
(Well, no, not exactly that statement, but part of it anyway: that the mapping acts on morphisms in a way that respects its action on objects.) –  Finn Lawler Jun 12 '12 at 17:42
@Joel David Hamkins: yes, thank you. I have edited the question accordingly. –  Jochen Trumpf Jun 13 '12 at 1:26
'Exponential' or 'mapping functor' are reasonable. –  David Roberts Jun 13 '12 at 1:54

I think you want to say something like the following:

Let $J,K:{\cal Sets}\times{\cal Sets}\times{\cal Sets}\rightarrow{\cal Sets}$ be defined by $$J(X,Y,Z)=Hom(X,Hom(Y,Z))$$ $$K(X,Y,Z)=Nat(Hom(Z,-),Hom(X,Hom(Y,-))$$ where "Nat" means the set of natural transformations between two functors.

(These will be contravariant in the first two variables and covariant in the third.)

Then the map $F\mapsto H^Y\circ F$ defines a natural transformation from $J$ to $K$.

This contains a bit more content because it says that your construction commutes with compositions with maps into and out of $X$, $Y$ and $Z$.

-
Ahem, this is heavy stuff ... I would love to accept your answer if only I understood it ... My understanding is that for $F\mapsto H^Y\circ F$ to define a natural transformation it needs to (for given $(X,Y,Z)$) constitute a morphism from $Hom(X,Hom(Y,Z))$ to $Nat(Hom(Z,-),Hom(X,Hom(Y,-)))$. It's this last bit that I don't get. In what sense is $H^Y\circ F$ a natural transformation between $Hom(Z,-)$ and $Hom(X,Hom(Y,-))$? –  Jochen Trumpf Jun 14 '12 at 11:35
Ah, I think I get it now. For given $W$, $H$ is an element of the image of $W$ under the functor $Hom(Z,-)$, and it gets mapped to $H^Y\circ F$, the image of $W$ under the functor $Hom(X,Hom(Y,-))$. Need to think of $F\mapsto H^Y\circ F$ as a "nested" map with additional argument $H$ then it makes sense. Great. –  Jochen Trumpf Jun 15 '12 at 4:44


text:
# Inclined

Level 2

In the arrangement shown above, all surfaces are frictionless. The rod R is constrained to move vertically. The vertical acceleration of R is a1 and the horizontal acceleration of the wedge W is a2. The ratio a1/a2 is equal to

×

Problem Loading...

Note Loading...

Set Loading...


text:
Problem2382--Hangover

### 2382: Hangover

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 3  Solved: 3
[Submit] [Status] [Web Board] [Creator:]

#### Description

How far can you make a stack of cards overhang a table? If you have one card, you can create a maximum
overhang of half a card length. (We're assuming that the cards must be perpendicular to the table.) With two
cards you can make the top card overhang the bottom one by half a card length, and the bottom one overhang
the table by a third of a card length, for a total maximum overhang of 1/2 + 1/3 = 5/6 card lengths. In general
you can make n cards overhang by 1/2 + 1/3 + 1/4 + ... + 1/(n + 1) card lengths, where the top card overhangs
the second by 1/2, the second overhangs tha third by 1/3, the third overhangs the fourth by 1/4, etc., and the
bottom card overhangs the table by 1/(n + 1). This is illustrated in the figure below.

#### Input

The input consists of one or more test cases, followed by a line containing the number 0.00 that signals the
end of the input. Each test case is a single line containing a positive floating-point number c whose value is at
least 0.01 and at most 5.20; c will contain exactly three digits.

#### Output

For each test case, output the minimum number of cards necessary to achieve an overhang of at least c card
lengths. Use the exact output format shown in the examples.

#### Sample Input Copy

1.00
3.71
0.04
5.19
0.00

#### Sample Output Copy

3 card(s)
61 card(s)
1 card(s)
273 card(s)


text:
manna2009branching
Branching process in a stochastic extremal model
S. S. Manna
Phys. Rev. E 80, 021132, 2009
We considered a stochastic version of the Bak-Sneppen model (SBSM) of ecological evolution where the the number $$M$$ of sites mutated in a mutation event is restricted to only two. Here the mutation zone consists of only one site and this site is randomly selected from the neighboring sites at every mutation event in an annealed fashion. The critical behavior of the SBSM is found to be the same as the BS model in dimensions $$d =1$$ and $$2$$. However on the scale-free graphs the critical fitness value is non-zero even in the thermodynamic limit but the critical behavior is mean-field like. Finally $$\langle M\rangle$$ has been made even smaller than two by probabilistically updating the mutation zone which also shows the original BS model behavior. We conjecture that a SBSM on any arbitrary graph with any small branching factor greater than unity will lead to a self-organized critical state.
Figure 1: The distributions $$P(f, N)$$ of the fitness values in the steady state of SBSM on the Barabasi-Albert scale-free graph. (a) Distribution plots for the graph sizes $$N = 2^7$$ (blue), $$2^{10}$$ (red) and $$2^{13}$$ (green). The jump in the distribution becomes gradually sharper with increasing the system sizes. (b) A finite-size scaling of this data shows an excellent collapse.


text:
Installing PLETHEM

PLETHEM can be run installed from CRAN

install.packages("plethem")

The most recent development version can be installed from

devtools::install_github("Scitovation/plethem")

and then use

library(plethem)

to start using PLETHEM.

Running rapidPBPK models

The rapidPBPK model within PLETHEM can be used to run forward dosimetry, monte carlo analysis, reverse dosimetry, and route to route extrapolation workflows. To start the rapidPBPK application

interactivePBPK()

Running HT-IVIVE models in PLETHEM

The High-Throughput IVIVE workflow within PELTHEM can be used to extrapolate in vitro points of depature to equivalent applied dose in vivo TO start the HT-IVIVE application

interactiveHT()

Running HTTK models

Models within the HTTK package can also be run using the same interactive modeling interface you saw previously. These models require the chemicals be a part of HTTK’s internal chemical database. Chemicals can be added to httk’s chemical database using the httk function

httk::add_chemtable(table)

This can be simplified if you are using RStudio. The gadget developed for adding data to httk’s chemical database can be invoked by running the command

addChemsToHTTK()

Once the chemical is added to the HTTK database, a new httk PBPK project can be created by using the commands above but replacing value of the parameter model to “httk_pbtk”


text:
2 of 6
Formatted problem statement

# How can this problem be reduced to a mathematical one

How can the states of ideal diodes be determined in simple circuits,
with only DC sources and resistors, without a trial and error approach?

I posted this question on Electronics SE and found out that there is none.

This is one of the situations which bugs me that something systematic is going on but I am not able to find it.

For instance:

This in an incredibly simple circuit.
The current has to circulate in certain directions
and only one set of states for diodes satisfy the circulation of current.
It frustrates me to solve this simple problem by guess and check.

It looks like solving $$2x=5$$ by trial and error!

So, what possible approaches can be used,

to analyze this type of circuits in a deterministic manner?

Or at least how can I approach this particular problem in deterministic way?

Hashir Omer
• 1558
• 1
• 13
• 27


text:
# N factorial is

Number Theory Level 2

$$n$$ is a positive integer such that

$$n!$$=$${\quad2}^{15}$$$${\times\quad 3}^{ 6 }$$$${\times\quad 5}^{3}$$$${\times\quad 7}^{2}$$$${\times\quad11\times13}$$

What is the value of $$n$$

×


text:
m
• E

F Nous contacter

0

# Documents  65F10 | enregistrements trouvés : 66

O

P Q

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Condition: the geometry of numerical algorithms - Lecture 1 Bürgisser, Peter | CIRM H

Post-edited

Research talks;Computer Science

The performance of numerical algorithms, both regarding stability and complexity, can be understood in a unified way in terms of condition numbers. This requires to identify the appropriate geometric settings and to characterize condition in geometric ways.
A probabilistic analysis of numerical algorithms can be reduced to a corresponding analysis of condition numbers, which leads to fascinating problems of geometric probability and integral geometry. The most well known example is Smale's 17th problem, which asks to find a solution of a given system of n complex homogeneous polynomial equations in $n$ + 1 unknowns. This problem can be solved in average (and even smoothed) polynomial time.
In the course we will explain the concepts necessary to state and solve Smale's 17th problem. We also show how these ideas lead to new numerical algorithms for computing eigenpairs of matrices that provably run in average polynomial time. Making these algorithms more efficient or adapting them to structured settings are challenging and rewarding research problems. We intend to address some of these issues at the end of the course.
The performance of numerical algorithms, both regarding stability and complexity, can be understood in a unified way in terms of condition numbers. This requires to identify the appropriate geometric settings and to characterize condition in geometric ways.
A probabilistic analysis of numerical algorithms can be reduced to a corresponding analysis of condition numbers, which leads to fascinating problems of geometric probability and integral ...

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Challenges in achieving scalable and robust linear solvers Grigori, Laura | CIRM H

Post-edited

Research talks

This talk focuses on challenges that we address when designing linear solvers that aim at achieving scalability on large scale computers, while also preserving numerical robustness. We will consider preconditioned Krylov subspace solvers. Getting scalability relies on reducing global synchronizations between processors, while also increasing the arithmetic intensity on one processor. Achieving robustness relies on ensuring that the condition number of the preconditioned matrix is bounded. We will discuss two different approaches for this. The first approach relies on enlarged Krylov subspace methods that aim at computing an enlarged subspace and obtain a faster convergence of the iterative method. The second approach relies on a multilevel Schwarz preconditioner, a multilevel extension of the GenEO preconditioner, that is basedon constructing robustly a hierarchy of coarse spaces. Numerical results on large scale computers, in particular for linear systems arising from solving linear elasticity problems, will discuss the efficiency of the proposed methods. This talk focuses on challenges that we address when designing linear solvers that aim at achieving scalability on large scale computers, while also preserving numerical robustness. We will consider preconditioned Krylov subspace solvers. Getting scalability relies on reducing global synchronizations between processors, while also increasing the arithmetic intensity on one processor. Achieving robustness relies on ensuring that the condition ...

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Numerical analysis :proceedings of the 8th biennal conference held at dundee#June 26-29 Watson, G. A. | Springer-Verlag 1980

Congrès

- 184 p.
ISBN 978-3-540-09740-2

Lecture notes in mathematics , 0773

Localisation : Collection 1er étage

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Multigrid methods :proceedings of the conference#Nov. 23-27 Hackbusch, W. ; Trottenberg, U. | Springer-Verlag 1982

Congrès

- 652 p.
ISBN 978-3-540-11955-5

Lecture notes in mathematics , 0960

Localisation : Collection 1er étage

algorithme # analyse de Fourier # méthode multigrille

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Preconditioned conjugate gradient methodsproceedings of a conference held in Nijmegen, the Netherlands, June 19-21, 1989 Axelsson, Owe ; Kolotilina, L. Yu. | Springer-Verlag 1990

Congrès

ISBN 978-3-540-53515-7

Lecture notes in mathematics , 1457

Localisation : Collection 1er étage

algèbre linéaire numérique # analyse numérique # méthode de Rayleygh-Ritz-Galerkin # méthode finie # méthode itérative pour les systèmes linéaires # solution des équations aux différences # éléments finis

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Iterative methods in linear algebraproceedings of the IMACS international symposium on iterative methods in linear algebra, Brussels, Belgium, 2-4 April, 1991 Beauwens, R. ; de Groen, P. | North-Holland 1992

Congrès

ISBN 978-0-444-89248-5

Localisation : Colloque 1er étage (BRUS)

algèbre linéaire # méthode de collocation # méthode itérative pour les systèmes linéaires # méthode multigrille # méthode numérique en probabilité et statistique # méthode spectrale # semi conducteur # stabilité de Lyapunov

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Domain decomposition methods in scientific and engineering computing :proceedings of the seventh international conference on domain decomposition methods, which was hosted by the Pennsylvania State University#Oct. 27-30 Keyes, David E. ; Xu, Jinchao | American Mathematical Society 1994

Congrès

- 546 p.
ISBN 978-0-8218-5171-5

Contemporary mathematics , 0180

Localisation : Collection 1er étage

algorithme # aérodynamique # espace de Sobolev # informatique scientifique et d'ingénierie # méthode de décomposition de domaine # méthode multigrille # parallélisme # problème de Helmholtz # problème elliptique # système en rotation # équation aux dérivées partielles # équation de Bellman # équation de Navier-Stokes

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Sparse matrix techniquesadvanced course held at the technical university of DenmarkAug. 9 - 12 Barker, V. A. | Springer-Verlag 1977

Congrès

ISBN 978-3-540-08130-2

Lecture notes in mathematics , 0572

Localisation : Collection 1er étage

calcul de valeur propre ou de vecteur propre # méthode directe générale # méthode directe pour problème d'élément fini # méthode itérative # solution de système linéaire d'équation # technique de matrice éparpillée

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Recent advances in numerical methods for partial differential equations and applications :proceedings of the 2001 John H. Barrett memorial lectures trends in comptational mathematics held at the University of Tennessee#May 10-12 Feng, Xiaobing ; Schulze, Tim P. | American Mathematical Society 2002

Congrès

- 177 p.
ISBN 978-0-8218-2970-7

Contemporary mathematics , 0306

Localisation : Collection 1er étage

EDP # solution numérique des équations # méthode multi-échelle # condition limite # dynamique des fluides # modèle de flux à 2 phases # flux de stokes # changement de phase # solidification # multigrille # simulation

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Fast algorithms for structured matrices :theory and applications#AMS-IMS-SIAM joint summer research conference on fast algorithms in mathematics, computer science and engineering held at Mount Holyoke College#Aug. 5-9 Olshevsky, Vadim | American Mathematical Society 2003

Congrès

- 433 p.
ISBN 978-0-8218-3177-9

Contemporary mathematics , 0323

Localisation : Collection 1er étage

matrice # transformation de Fourier # algorithme # interpolation rationnelle # décodage d'algorithme # algèbre de Lie # optimisation # résolution d'équation matricielle

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Recent advances in matrix and operator theory#July 24-27 Ball, Joseph A. ; Eidelman, Yuli ; helton, J.William ; Olshevsky, Vadim | Birkhäuser 2007

Congrès

- 338 p.
ISBN 978-3-7643-8538-5

Operator theory: advances and applications , 0179

Localisation : Collection 1er étage

théorie des opérateurs # algèbre linéaire et multi-linéaire # théorie des matrices # groupes ordonnés # problèmes inverses # fonction spectrale # mesure spectrale # transformation non-linéaire # fonctions à variables complexes # théorie des perturbations

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Krylov subspace solvers and preconditioners Vuik, Kees | CIRM H

Multi angle

Research schools;Computer Science

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Time parallel time integration Gander, Martin | CIRM H

Multi angle

Research schools

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Linear solvers for reservoir simulation Hénon, Pascal | CIRM H

Multi angle

Research talks

In this presentation, we will first present the main goals and principles of reservoir simulation. Then we will focus on linear systems that arise in such simulation. The main HPC challenge is to solve those systems efficiently on massively parallel computers. The specificity of those systems is that their convergence is mostly governed by the elliptic part of the equations and the linear solver needs to take advantage of it to be efficient. The reference method in reservoir simulation is CPR-AMG which usually relies on AMG to solve the quasi elliptic part of the system. We will present some works on improving AMG scalability for the reservoir linear systems (work done in collaboration with CERFACS). We will then introduce an on-going work with INRIA to take advantage of their enlarged Krylov method (EGMRES) in the CPR method. In this presentation, we will first present the main goals and principles of reservoir simulation. Then we will focus on linear systems that arise in such simulation. The main HPC challenge is to solve those systems efficiently on massively parallel computers. The specificity of those systems is that their convergence is mostly governed by the elliptic part of the equations and the linear solver needs to take advantage of it to be efficient. The ...

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Efficient iterative solvers: FETI methods with multiple search directions Roux, François-Xavier | CIRM H

Multi angle

Research talks

In domain decomposition methods, most of the computational cost lies in the successive solutions of the local problems in subdomains via forward-backward substitutions and in the orthogonalization of interface search directions. All these operations are performed, in the best case, via BLAS-1 or BLAS-2 routines which are inefficient on multicore systems with hierarchical memory. A way to improve the parallel efficiency of the method consists in working with several search directions, since multiple forward-backward substitutions and reorthogonalizations involve BLAS-3 routines. In the case of a problem with several right-hand-sides, using a block Krylov method is a straightforward way to work with multiple search directions. This will be illustrated with an application in electromagnetism using FETI-2LM method. For problems with a single right-hand-side, deriving several search directions that make sense from the optimal one constructed by the Krylov method is not so easy. The recently developed S-FETI method gives a very good approach that does not only improve parallel efficiency but can also reduce the global computational cost in the case of very heterogeneous problems. In domain decomposition methods, most of the computational cost lies in the successive solutions of the local problems in subdomains via forward-backward substitutions and in the orthogonalization of interface search directions. All these operations are performed, in the best case, via BLAS-1 or BLAS-2 routines which are inefficient on multicore systems with hierarchical memory. A way to improve the parallel efficiency of the method consists in ...

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Algebraic multigrid and subdivision Charina, Maria | CIRM H

Multi angle

Research talks

Multigrid is an iterative method for solving large linear systems of equations whose Toeplitz system matrix is positive definite. One of the crucial steps of any Multigrid method is based on multivariate subdivision. We derive sufficient conditions for convergence and optimality of Multigrid in terms of trigonometric polynomials associated with the corresponding subdivision schemes.
(This is a joint work with Marco Donatelli, Lucia Romani and Valentina Turati).
Multigrid is an iterative method for solving large linear systems of equations whose Toeplitz system matrix is positive definite. One of the crucial steps of any Multigrid method is based on multivariate subdivision. We derive sufficient conditions for convergence and optimality of Multigrid in terms of trigonometric polynomials associated with the corresponding subdivision schemes.
(This is a joint work with Marco Donatelli, Lucia Romani and ...

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Condition: the geometry of numerical algorithms - Lecture 2 Bürgisser, Peter | CIRM H

Multi angle

Research talks;Computer Science

The performance of numerical algorithms, both regarding stability and complexity, can be understood in a unified way in terms of condition numbers. This requires to identify the appropriate geometric settings and to characterize condition in geometric ways.
A probabilistic analysis of numerical algorithms can be reduced to a corresponding analysis of condition numbers, which leads to fascinating problems of geometric probability and integral geometry. The most well known example is Smale's 17th problem, which asks to find a solution of a given system of n complex homogeneous polynomial equations in $n$ + 1 unknowns. This problem can be solved in average (and even smoothed) polynomial time.
In the course we will explain the concepts necessary to state and solve Smale's 17th problem. We also show how these ideas lead to new numerical algorithms for computing eigenpairs of matrices that provably run in average polynomial time. Making these algorithms more efficient or adapting them to structured settings are challenging and rewarding research problems. We intend to address some of these issues at the end of the course.
The performance of numerical algorithms, both regarding stability and complexity, can be understood in a unified way in terms of condition numbers. This requires to identify the appropriate geometric settings and to characterize condition in geometric ways.
A probabilistic analysis of numerical algorithms can be reduced to a corresponding analysis of condition numbers, which leads to fascinating problems of geometric probability and integral ...

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Computational methods for large-scale matrix equations and application to PDEs Simoncini, Valeria | CIRM H

Multi angle

Research talks

Linear matrix equations such as the Lyapunov and Sylvester equations and their generalizations have classically played an important role in the analysis of dynamical systems, in control theory and in eigenvalue computation. More recently, matrix equations have emerged as a natural linear algebra framework for the discretized version of (systems of) partial differential equations (PDEs), possibly evolving in time. In this new framework, new challenges have arisen. In this talk we review some of the key methodologies for solving large scale linear and quadratic matrix equations. We will also discuss recent matrix-based strategies for the numerical solution of time-dependent problems arising in control and in the analysis of spatial pattern formations in certain electrodeposition models. Linear matrix equations such as the Lyapunov and Sylvester equations and their generalizations have classically played an important role in the analysis of dynamical systems, in control theory and in eigenvalue computation. More recently, matrix equations have emerged as a natural linear algebra framework for the discretized version of (systems of) partial differential equations (PDEs), possibly evolving in time. In this new framework, new ...

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Multigrid and domain decomposition: similarities and differences Gander, Martin | CIRM H

Multi angle

Research talks

Both multigrid and domain decomposition methods are so called optimal solvers for Laplace type problems, but how do they compare? I will start by showing in what sense these methods are optimal for the Laplace equation, which will reveal that while both multigrid and domain decomposition are iterative solvers, there are fundamental differences between them. Multigrid for Laplace’s equation is a standalone solver, while classical domain decomposition methods like the additive Schwarz method or Neumann-Neumann and FETI methods need Krylov acceleration to work. I will explain in detail for each case why this is so, and then also present modifications so that Krylov acceleration is not necessary any more. For overlapping methods, this leads to the use of partitions of unity, while for non-overlapping methods, the coarse space can be a remedy. Good coarse spaces in domain decomposition methods are very different from coarse spaces in multigrid, due to the very aggressive coarsening in domain decomposition. I will introduce the concept of optimal coarse spaces for domain decomposition in a sense very different from the optimal above, and then present approximations of this coarse space. Together with optimized transmission conditions, this leads to a two level domain decomposition method of Schwarz type which is competitive with multigrid for Laplace’s equation in wallclock time. Both multigrid and domain decomposition methods are so called optimal solvers for Laplace type problems, but how do they compare? I will start by showing in what sense these methods are optimal for the Laplace equation, which will reveal that while both multigrid and domain decomposition are iterative solvers, there are fundamental differences between them. Multigrid for Laplace’s equation is a standalone solver, while classical domain ...

Déposez votre fichier ici pour le déplacer vers cet enregistrement.

## Applied iterative methods Hageman, Louis A. ; Young, David M. | Academic Press 1981

Ouvrage

- 386 p.
ISBN 978-0-12-313340-3

Computer science and applied mathematics

Localisation : Ouvrage RdC (HAGE)

65F10

#### Filtrer

##### Codes MSC

Ressources Electroniques (Depuis le CIRM)

Books & Print journals

Recherche avancée

0
Z


text:
Topics in Algebra, Chapter 3.7

2013-01-13

This page covers section 3.7 (“Euclidean Rings”). Throughout, $R$ is a ring.

Topics covered: 3.7

• Definition: The integral domain $R$ is a Euclidean ring if there exists $d:R\setminus 0\to {\mathbb{Z}}^{\ast }$ such that

1. $d\left(a\right)\le d\left(ab\right)$ for $a,b\in R\setminus 0$.

2. For $a,b\in R\setminus 0$, there exist $r,s\in R$ with $a=sb+r$ and either $r=0$ or $d\left(r\right).

Here, ${\mathbb{Z}}^{\ast }$ is the set of non-negative integers. This generalizes the Euclidean algorithm of the integers.

• Theorem 3.7.1: If $I$ is an ideal of the Euclidean ring $R$, then there exists $a\in R$ such that $I=\left(a\right)=\left\{ax\mid x\in R\right\}$. In other words, $I$ must be principal.

• Definition: A principal ideal domain (PID) is a ring all of whose ideals are principal. By Theorem 3.7.1, a Euclidean ring is always a PID.

• Corollary: A Euclidean ring is unital.

• Definition: Let $R$ be commutative and let $a,b\in R$ with $a\mathrm{\ne }0$. $a$ divides $b$, or $a\mid b$, if there exists $c\in R$ with $b=ac$.

• Definition: Let $R$ be commutative and let $a,b,d\in R$ with $a,b\mathrm{\ne }0$. $d$ is a greatest common divisor of $a$ and $b$ if $d\mid a$ and $d\mid b$ and, if $c\mid a$ and $c\mid b$, then $c\mid d$.

• Lemma 3.7.1: Let $R$ be Euclidean and let $a,b\in R$ be non-zero. There exists a greatest common divisor $d\in R$ of $a$ and $b$, and there exist $r,s\in R$ such that $d=ra+sb$.

• Definition: Let $R$ be commutative and unital. Element $a\in R$ is a unit if there exists $b\in R$ with $ab=1$.

• Lemma 3.7.2: Let $R$ be an integral domain and let $a,b\in R$ be such that $a\mid b$ and $b\mid a$. Then $a=ub$ for some unit $u\in R$.

• Definition: Let $R$ be commutative and unital and let $a,b\in R$. If there exists a unit $u\in R$ such that $a=ub$, then $a$ and $b$ are associates.

• Lemma 3.7.3: Let $R$ be Euclidean and let $a,b\in R$. If $b\mathrm{\ne }0$ is not a unit, then $d\left(a\right).

• Definition: Let $R$ be Euclidean. A non-unit $\pi \in R$ is prime if, with $a,b\in R$, $\pi =ab$ implies that one of $a$ or $b$ is a unit.

• Lemma 3.7.4: Let $R$ be Euclidean. Every element in $R$ is either a unit or expressible as a finite product of prime elements in $R$.

• Definition: Let $R$ be Euclidean and let $a,b\in R$. $a$ and $b$ are relatively prime if their greatest common divisor is a unit in $R$.

• Lemma 3.7.5: Let $R$ be Euclidean and let $a,b,c\in R$ be such that $a\mid bc$ but $\left(a,b\right)=1$. Then $a\mid c$.

• Lemma 3.7.6: Let $R$ be Euclidean and let $a,b,\pi \in R$ with $\pi$ prime. If $\pi \mid ab$ then $\pi$ divides $a$ or $b$ or both.

• Theorem 3.7.2 (unique factorization): Let $R$ be Euclidean and let $a\in R$ be non-zero. It is possible to factorize $a$ as a product of primes, and that factorization is unique up to multiplication by units. In particular, the number of primes in the product is the same for any such factorization.

• Lemma 3.7.7: An ideal $I=\left(a\right)$ of Euclidean ring $R$ is maximal if and only if $a$ is prime.

The problems below are paraphrased from/inspired by those given in Topics in Algebra by Herstein. The solutions are my own unless otherwise noted. I will generally try, in my solutions, to stick to the development in the text. This means that problems will not be solved using ideas and theorems presented further on in the book.

Herstein 3.7.1: Let $R$ be commutative and unital. Show that the relation $a\sim b$ if $a$ is an associate of $b$ is an equivalence relation.

Let $r,s,t\in R$.

1. $\sim$ is reflexive: $r=r1$ so that $r\sim r$.

2. $\sim$ is symmetric: If $r\sim s$, then suppose $u\in R$ is the unit such that $r=su$. There exists ${u}^{\mathrm{\prime }}\in R$ with $u{u}^{\mathrm{\prime }}=1$, and multiplying by this ${u}^{\mathrm{\prime }}$ gives $s=r{u}^{\mathrm{\prime }}$ and therefore $s\sim r$.

3. $\sim$ is transitive: If $r\sim s$ and $s\sim t$, then there are units $u,v\in R$ with $r=su$ and $s=tv$. Of course, $r=t\left(uv\right)$ and, because $uv$ is a unit, $r\sim t$. $uv$ is a unit because there exists ${u}^{\mathrm{\prime }},{v}^{\mathrm{\prime }}\in R$ with $u{u}^{\mathrm{\prime }}=v{v}^{\mathrm{\prime }}=1$, and $\left(uv\right)\left({u}^{\mathrm{\prime }}{v}^{\mathrm{\prime }}\right)=1$.

Herstein 3.7.2: Let $R$ be Euclidean. Prove that any two greatest two common divisors of $a,b\in R$ are associates.

Let ${d}_{1}$ and ${d}_{2}$ be two greatest common divisors of $a$ and $b$. If $c$ divides both $a$ and $b$, then it must also divide a greatest common divisor. In particular, ${d}_{2}$ must, as a divisor of $a$ and $b$, divide ${d}_{1}$. Then ${d}_{1}={d}_{2}r$ for some $r\in R$. By the same token, there exists $s\in R$ such that ${d}_{2}={d}_{1}s$. Then ${d}_{1}={d}_{1}rs$, or ${d}_{1}\left(1-rs\right)=0$. We have $rs=1$ so that $r$ and $s$ are units, and therefore ${d}_{1}$ and ${d}_{2}$ are associates.

Alternately, we can appeal to Lemma 3.7.2.

Herstein 3.7.3: Let $R$ be Euclidean. Prove that $a\in R$ is a unit if and only if $d\left(a\right)=d\left(1\right)$.

If $a$ is a unit, then there exists $b\in R$ with $ab=1$. We have that $d\left(a\right)\le d\left(ab\right)=d\left(1\right)$. This looks promising, but what precludes $d\left(1\right)$ from being something big, and $d\left(a\right)$ fitting comfortably beneath it? Well, we also have $d\left(1\right)\le d\left(a1\right)=d\left(a\right)$, and so we conclude that $d\left(a\right)=d\left(1\right)$.

On the other hand, if $d\left(a\right)=d\left(1\right)$, then we would like to show that $a$ is a unit. By the Euclidean algorithm, there exists $t,r\in R$ such that $1=ta+r$ and either $r=0$ or $d\left(r\right). It is, however, impossible for $d\left(r\right)$ to be smaller than $d\left(a\right)$. To see this, consider that $d\left(1\right)\le d\left(r1\right)=d\left(r\right)$ while $d\left(a\right)=d\left(1\right)$ by assumption! Therefore we have $r=0$ and $at=1$ so that $a$ is a unit.

Herstein 3.7.4: Let $R$ be Euclidean and let $a,b\in R$. Prove that their greatest common divisor $\left(a,b\right)$ may be found by

\begin{aligned} b=q_0 a+r_1\qquad & {\rm where}\qquad d(r_1)
\cdots &
r

Clearly, by the Euclidean algorithm, each step in the procedure is acceptable in its own right. We also see that it will terminate in the form ${r}_{n-1}={q}_{n}{r}_{n}$ for some $n$, because the norms of the remainders constitute a monotonically decreasing sequence in the positive integers (as defined by Herstein, the remainder can either be zero or smaller in norm than the divisor, because the norm of the zero element is not defined). The non-trivial statement here is that this terminating divisor, ${r}_{n}$, is in fact $\left(a,b\right)\mathrm{.}$

Stepping up the chain, we have that ${r}_{n-2}={q}_{n-1}{r}_{n-1}+{r}_{n}=\left({q}_{n-1}{q}_{n}+1\right){r}_{n}$

so that ${r}_{n}\mid {r}_{n-2}$. Iterating this easily shows that ${r}_{n}\mid {r}_{i}$ for all $0. Then also ${r}_{n}\mid \left({q}_{1}{r}_{1}+{r}_{2}\right)=a$

and ${r}_{n}\mid \left({q}_{0}a+{r}_{1}\right)=b\mathrm{.}$

Thus we have proven, or at least sketched a proof, that ${r}_{n}$ divides both $a$ and $b$.

If we can additionally prove that ${r}_{n}=\lambda a+\mu b$ for some $\lambda ,\mu \in R$, then we will be done. Why? If $c\in R$ is another divisor of both $a$ and $b$, then $c\mid \lambda a$ and $c\mid \mu b$ so that $c\mid {r}_{n}$. But this is actually easy to see. If we re-arrange each step of the algorithm, we find that ${r}_{1}=1b-{q}_{0}a$ and ${r}_{2}=a-{q}_{1}{r}_{1}=\left(1+{q}_{0}{q}_{1}\right)a-{q}_{1}b$, and so forth. Proceeding in this way, we can express every remainder as a linear combination of $a$ and $b$. Finally, we arrive at ${r}_{n-2}={q}_{n-1}{r}_{n-1}+{r}_{n}$

which is at last rearranged into the form ${r}_{n}=\lambda a+\mu b$.

Notice that we are implicitly working in the ideal $I\left(a,b\right)=\left\{ra+sb\mid r,s\in R\right\}$. Theorem 3.7.1 showed that any ideal of a Euclidean ring is actually principal, that is, generated by a single element. Lemma 3.7.1 showed further that this ideal $I\left(a,b\right)$ is generated by a greatest common divisor of $a$ and $b$. Of course, there may be lesser common divisors, for instance $\left(4,8\right)=4$ while $2\mid 4$ and $2\mid 8$. The lesser common divisors, however, do not gain entrance to our ideal! Put another way, they may not be expressed as a linear combination of $a$ and $b$. Out of all simultaneous divisors, only a greatest common divisor admits a representation as a linear combination of $a$ and $b$.

Herstein 3.7.5: Let $R$ be commutative and unital. Prove that if an ideal $I$ of $R$ contains a unit, then $I=R$.

Suppose there is a unit $u\in I$ so there exists $v\in R$ such that $uv=1$. Let $r\in R$ be arbitrary. We have $u\left(vr\right)=\left(uv\right)r=r\in I$ so that $R\subset I$ and therefore $I=R$.

Herstein 3.7.6: Let $R$ be commutative and unital. Prove that the units of $R$ form an abelian group.

Let $U\left(R\right)$ be the set of units of $R$. We will let $U\left(R\right)$ inherit the associative, commutative ring multiplication. Of course, $11=1$ so that $1\in U\left(R\right)$. Letting $u\in U\left(R\right)$, we have $v\in R$ such that $uv=1$. This also means that $v\in U\left(R\right)$ and hence $U\left(R\right)$ contains inverses. Finally, we note that if ${u}_{1},{u}_{2}\in U\left(R\right)$, then ${u}_{1}{u}_{2}$ is also a unit. There exist ${v}_{1},{v}_{2}\in R$ such that ${u}_{1}{v}_{1}=1$ and ${u}_{2}{v}_{2}=1$. Then ${u}_{1}{u}_{2}{v}_{1}{v}_{2}=1$ so that ${u}_{1}{u}_{2}\in U\left(R\right)$ and the set is closed under multiplication.

Herstein 3.7.7: Let $R$ be Euclidean and let $a,b\in R$. A least common multiple of $a$ and $b$ is a number $c\in R$ such that (1) $a\mid c$ and $b\mid c$, and (2) if $x\in R$ is such that $a\mid x$ and $b\mid x$, then $c\mid x$. Prove that $a$ and $b$ have a least common multiple in $R$.

The existence of a greatest common divisor was shown in Lemma 3.7.1, where the ideal $I\left(a,b\right)=\left\{ra+sb\mid r,s\in R\right\}$ was employed. We seek another natural ideal to consider. Clearly we want to look at elements of $R$ which are multiples of both $a$ and $b$. The multiples of $a$ are the ideal $\left(a\right)=\left\{ra\mid r\in R\right\}$ while the multiples of $b$ are the ideal $\left(b\right)=\left\{rb\mid r\in R\right\}$. The intersection of those ideals, $J=\left(a\right)\cap \left(b\right),$

is again an ideal and its elements are exactly those which are divisible by both $a$ and $b$. By Theorem 3.7.1, $J$ is generated by some element $l\in R$ and we claim that $l$ is a least common multiple of $a$ and $b$. As $l\in J$, we have that $a\mid l$ and $b\mid l$. If $x\in R$ is such that $a\mid x$ and $b\mid x$, then $x\in J$ and so $l\mid x$. Therefore we have exhibited a least common multiple of $a$ and $b$.

Herstein 3.7.8: Let $R$ be Euclidean and let $a,b\in R$. Denoting least common multiple by $\left[a,b\right]$ and greatest common divisor by $\left(a,b\right)$, show that $\left[a,b\right]\left(a,b\right)=ab$.

By Theorem 3.7.2, we can express $a={p}_{1}\cdots {p}_{m}\phantom{\rule{2em}{0ex}}\mathrm{a}\mathrm{n}\mathrm{d}\phantom{\rule{2em}{0ex}}b={q}_{1}\cdots {q}_{n}$

with the ${p}_{i}$ and ${q}_{j}$ prime elements of $R$. We can construct a greatest common divisor of $a$ and $b$ by iterating through the list $P=\left\{{p}_{i}\right\}$ and picking out those primes which also appear in the list of $Q=\left\{{q}_{j}\right\}$ (up to associates). Taking this subset ${P}^{\mathrm{\prime }}$ of the $P$ and computing its product gives a ring element $d$, which will be a greatest common divisor. It is clear, because it is a product of primes which divide both $a$ and $b$, that $d\mid a$ and $d\mid b$. Furthermore, any other $x\in R$ with $x\mid a$ and $x\mid b$ must have $x\mid d$: suppose it were otherwise, then there would be a prime $\pi \in R$ with $\pi \mid x$, so therefore $\pi \mid a$ and $\pi \mid b$, but $\pi \mid d$. This contradicts the construction of $d$. Therefore $d$ is a greatest common divisor of $a$ and $b$.

Now that the list of $P$ has been pared down somewhat, we can take a product over the remaining $P\setminus {P}^{\mathrm{\prime }}$ and over all of the $Q$, and call this product $l$. Because nothing has been removed from $Q$, we see that both $a\mid l$ and $b\mid l$: $Q$ still contains all of the primes that were common to $a$ and $b$, and $P\setminus {P}^{\mathrm{\prime }}$ retains whatever was left over from $a$ after the culling. If $x$ is another multiple of $a$ and $b$, so $a\mid x$ and $b\mid x$, then we must have $l\mid x$: suppose it were otherwise, then there would be a prime $\pi \in R$ with $\pi \mid l$ but not $\pi \mid x$. Of course, every prime dividing $l$ must divide one or both of $a$ and $b$, so this would show that $x$ could not be a common multiple. Therefore we must have $l\mid x$ and hence $l$ is a least common multiple of $a$ and $b$.

Finally, we have that $dl={p}_{1}\cdots {p}_{m}{q}_{1}\cdots {q}_{n}=ab$

which is the desired result.


text:
Classifying complex conics up to isomorphism as quotient rings of $\mathbb{C}$

This is a continuation of the question I asked here. The problem is now:

Let $Q = ax^2 + bxy + cy^2 + dx + ey + f \in \mathbb{C}[x,y]$ be a general quadratic polynomial, that is, $a,b,c \not= 0$. A change of coordinates allows this to be rewritten as $Q = x^2 + cy^2 + ey + f$. Classify the rings $\mathbb{C}[x,y]/(Q)$ up to isomorphism. For each isomorphism class, draw a picture of a corresponding variety. Determine if it is reducible and/or connected, and whether $(Q)$ is radical.

I’ve tried to factor the equation $Q = 0$ in the following way:

$$Q = 0 \implies x^2 + c \left( y + \frac{e}{2c} \right)^2 = \frac{e^2}{4c} -f$$
Now, if either $e$ or $f$ is nonzero then this is the equation for an ellipse. It should be straightforward to find a parametrizaton using sine and cosine, that is, we should get $\mathbb{C}[x,y]/(Q) \simeq \mathbb{C}[\cos{t},\sin{t}]$.

On the other hand, if $e$ and $f$ are both zero, then the equation
$$x^2 + cy^2 = (x + i\sqrt{c}y)(x – i\sqrt{c}y)=0$$
can be factored, so this is a reducible polynomial. In this case, $y$ is just $x$ times a constant, so $\mathbb{C}[x,y]/(Q)$ should be isomorphic to $\mathbb{C}[x]$.

And… that’s it! Those are the only two cases I could find. But I feel like I must have missed something very important. In $\mathbb{R}$, there are many kinds of conics: hyperbolas, ellipses, parabolas, and degenerate cases. Surely there can’t just be two cases in $\mathbb{C}$?

I’m also struggling with the last part of the problem: I have no idea how to draw a complex curve (four dimensions required?) and I don’t know how to determine if a variety is connected. I think the first case (the ellipse) is an irreducible polynomial, so the variety is also irreducible and the corresponding ideal is radical. The second case (the reducible polynomial) is a reducible variety, but does that mean the ideal is not radical?

Solutions Collecting From Web of "Classifying complex conics up to isomorphism as quotient rings of $\mathbb{C}$"

The classification of conics in $\mathbb A^2$ shows that there are the following possibilities:

1. $\mathbb C[X]$ and $\mathbb C[X,X^{-1}]$ (for the irreducible ones);

2. $\mathbb C[X]/(X^2)$, $\mathbb C[X]/(X^2-1)\simeq\mathbb C\times\mathbb C$, and $\mathbb C[X,Y]/(X^2-Y^2)\simeq\mathbb C[X,Y]/(XY)$ (for the reducible ones).